-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
fix: deletes all sessions for user on logout #2071
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Coverage report
Test suite run success1159 tests passing in 191 suites. Report generated by 🧪jest coverage report action from 180855a |
tests added both for invalidating sessions when changing password and for logging out |
app.use('/logout', new LogoutController(config, { sessionService }).router); | ||
await supertest(app).get('/logout').expect(302); | ||
let activeSessions = await sessionStore.getSessionsForUser(1); | ||
expect(activeSessions).toHaveLength(0); |
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.
nice
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.
LGTM
.post(`/api/admin/user-admin/${user.id}/change-password`) | ||
.send({ password: 'simple123-_ASsad' }) | ||
.expect(200); | ||
expect(spy).toHaveBeenCalled(); |
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.
nice:D
To ensure we clean up sessions on logout this PR does two things:
Will add a test before moving from draft