Feat: adds async local storage to admin server
This commit is contained in:
parent
8128f05ffb
commit
cb2e1b3907
5 changed files with 47 additions and 8 deletions
|
|
@ -30,8 +30,7 @@ const authenticateUser = (username, password) => {
|
|||
|
||||
const destroySessionIfSameUser = (context, user) => {
|
||||
const sessionUser = getUserFromCookie(context)
|
||||
if (sessionUser && user.id === sessionUser.id)
|
||||
context.req.session.destroy()
|
||||
if (sessionUser && user.id === sessionUser.id) { context.req.session.destroy() }
|
||||
}
|
||||
|
||||
const destroySessionIfBeingUsed = (sessID, context) => {
|
||||
|
|
@ -60,7 +59,7 @@ const executeProtectedAction = (code, id, context, action) => {
|
|||
if (user.role !== 'superuser') {
|
||||
return action()
|
||||
}
|
||||
|
||||
|
||||
return confirm2FA(code, context)
|
||||
.then(() => action())
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue