-
Notifications
You must be signed in to change notification settings - Fork 0
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
SMA-80: allow logging in and signing up with expired jwt token #71
SMA-80: allow logging in and signing up with expired jwt token #71
Conversation
…th-expired-jwt-token
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still like it to be a little differently, sorry. (At least if it does what i think it does)
try { | ||
userEmail = jwtService.extractUserName(jwt); | ||
} catch (Exception e) { | ||
response.setStatus(HttpStatus.UNAUTHORIZED.value()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this let you see public endpoints when you have invalid token?
I think it may be better to simply not add anything to the user context (instead of returning 401) and thus still allowing access to public endpoints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
In the Navbar changed the code to delete token from local storage if the HTML error code is 401 or 403
In PrivateRoute used the same code, instead of checking if there is a token in the local storage.