Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guest access without bearer token #40

Open
sekrett opened this issue Jan 30, 2021 · 1 comment
Open

Guest access without bearer token #40

sekrett opened this issue Jan 30, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@sekrett
Copy link

sekrett commented Jan 30, 2021

I would like a configuration option allowing to have a guest access. If no bearer token was sent, then authenticate_and_set_user should just return without any error and current_user would be left as nil. The line to change is this: https://github.com/Gokul595/api_guard/blob/master/lib/api_guard/jwt_auth/authentication.rb#L28

I managed myself to create a different before_action based on authenticate_and_set_resources doing exactly what I want, but a configuration for letting both behaviours would be great. Tell me if you need this in your gem, I will do a PR.

@sekrett sekrett added the enhancement New feature or request label Jan 30, 2021
@Gokul595
Copy link
Owner

Gokul595 commented Feb 2, 2021

@sekrett Getting this feature request for second time. @xxSkyy requested this in an issue #38 few weeks back.

So, I think we can add this option and make this configurable. Please do the change and submit a PR. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants