Browse Source
Merge pull request #5151 from mslourens/prevent_multiple_sessions
invalidate sessions before login
master
Martin McKeaveney
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
0 deletions
-
packages/backend-core/src/security/sessions.js
|
|
|
@ -15,6 +15,9 @@ function makeSessionID(userId, sessionId) { |
|
|
|
} |
|
|
|
|
|
|
|
exports.createASession = async (userId, session) => { |
|
|
|
// invalidate all other sessions
|
|
|
|
await this.invalidateSessions(userId) |
|
|
|
|
|
|
|
const client = await redis.getSessionClient() |
|
|
|
const sessionId = session.sessionId |
|
|
|
if (!session.csrfToken) { |
|
|
|
|