question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement Logout Route

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
servermonkcommented, Oct 1, 2020

sure @ruddha2001, I have assigned this issue to you. All the Best!!

1reaction
ruddha2001commented, Oct 1, 2020

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 to expiresIn. 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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found