Implement Logout Route
See original GitHub issueIs your feature request related to a problem? Please describe. Implement a working logout route
Describe the solution you’d like
On going to the logout route, the JWT token should be destroyed and the user would not be able to access protected routes.
The route should be: ‘/users/logout’. You could make a new file named logout.js
in the users
folder and implement logout route there
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How do I implement a Logout functionality from a React ...
I am trying to implement a logout functionality and am not sure what I need to do to implement it with my current...
Read more >How to implement a logout method in an Express application
In our application we have a specific router that defines all the authorization routes, called authRouter , so let's set up the logout...
Read more >Implementing client-side logout with React Router V4
Implementing client-side logout with React Router V4 · Clear the token in localStorage · Push the url for the homepage onto the history...
Read more >login-logout-with-react-router - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >Redirect on Login and Logout - SST.Dev
Redirect the user to the homepage after they login. And redirect them back to the login page after they logout. We are going...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
sure @ruddha2001, I have assigned this issue to you. All the Best!!
Hello. I would like to take up this issue.
My proposed solution is to use a “blocklist” approach. I plan to use the
expiresIn
property of the token during the creation. And will have a blocklist maintained in the cache with TTL equal toexpiresIn
. This will mean after a user logs out, the JWT will be blocked and cannot be used to access any route.This is dependent on #19 (I will use 15 minutes for TTL as specified in the issue).