Skip to content

StoreToken introduced + a token is written to request.Env to be able …#10

Open
ruseinov wants to merge 5 commits intoStephanDollberg:masterfrom
ruseinov:master
Open

StoreToken introduced + a token is written to request.Env to be able …#10
ruseinov wants to merge 5 commits intoStephanDollberg:masterfrom
ruseinov:master

Conversation

@ruseinov
Copy link
Copy Markdown

…to use it in the Authorizator

I'd needed that hook to support checking these tokens against Redis or any other storage.
If you find that viable for your product - feel free to merge. In my opinion extra hook does not hurt.
That's what I've been missing in a lot of middlewares, yours is almost perfect for my needs.

@StephanDollberg
Copy link
Copy Markdown
Owner

Hi @ruseinov,

Thanks for your PR.

I am not really sure whether this is in the scope of this middleware and makes sense in general. Could you maybe share what your usecases for this are?

Cheers,
Stephan

@Stunkymonkey
Copy link
Copy Markdown

Hi @StephanDollberg ,

i am missing this feature too.
In this case you can not really logout of your site. If someone else has stolen your JWT, he will still be able to login, without any problems. The only "logout" would be, that the Token expires.

The solution would be to store the JWT in a database and if a user is logging out, delete the entry. (still check if the token is valid)

in this case you will never be able to store the JWT anywhere. Thats why he wants the feature

Greetings,
Stunkymonkey

@ruseinov
Copy link
Copy Markdown
Author

Hello @StephanDollberg,

What @Stunkymonkey said basically.

Best,
Roman

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants