Replies: 1 comment 2 replies
-
|
what was the solution? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to know, how would go if you wanted to setup a route, which can be called when you are authenticated (using JWT for example), so you get the current user. But you can also allow unauthenticated User and get None instead of the current_user.
The problem is that
current_user_from_tokenis called after the JWTCookieAuth checks for a JWT token. So if there's no token it raises a 401.And if I set
exclude_from_auth=Trueon my route, even if the user is authenticated I getcurrent_user == None.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions