Skip to content

Can I customize middlewareImpl or MiddlewareFunc? #199

Description

@pashinin

I'd like to use this extension but I want to redefine it's core function. Can I do this?

What I actually want to do

I want not to terminate request if JWT is wrong or empty like here:

if err != nil {

But instead let each endpoint to decide what is allowed and what is not based on context["id"] which was set by middleware either to nil or User model.

So I want this middleware only to do all JWT stuff and c.Set(mw.IdentityKey, identity) but not to make any 401 respond.

If I can do it now - can you show how?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions