catch block in invalidate sessions
This commit is contained in:
parent
bf0ca9784b
commit
50c6ad9630
|
@ -15,6 +15,7 @@ function makeSessionID(userId, sessionId) {
|
|||
}
|
||||
|
||||
async function invalidateSessions(userId, sessionIds = null) {
|
||||
try {
|
||||
let sessions = []
|
||||
|
||||
// If no sessionIds, get all the sessions for the user
|
||||
|
@ -38,6 +39,9 @@ async function invalidateSessions(userId, sessionIds = null) {
|
|||
promises.push(client.delete(session.key))
|
||||
}
|
||||
await Promise.all(promises)
|
||||
} catch (err) {
|
||||
console.error(`Error invalidating sessions: ${err}`)
|
||||
}
|
||||
}
|
||||
|
||||
exports.createASession = async (userId, session) => {
|
||||
|
|
Loading…
Reference in New Issue