Skip to content

Guest access without bearer token #40

@sekrett

Description

@sekrett

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions