mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
jwt functions are async now, await them
This commit is contained in:
parent
36d40cbe40
commit
4f0910baf1
@ -21,7 +21,7 @@ export const isAuthorized: AuthChecker<Context> = async ({ context }, rights) =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Decode the token
|
// Decode the token
|
||||||
const decoded = decode(context.token)
|
const decoded = await decode(context.token)
|
||||||
if (!decoded) {
|
if (!decoded) {
|
||||||
throw new LogError('403.13 - Client certificate revoked')
|
throw new LogError('403.13 - Client certificate revoked')
|
||||||
}
|
}
|
||||||
@ -49,6 +49,6 @@ export const isAuthorized: AuthChecker<Context> = async ({ context }, rights) =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set new header token
|
// set new header token
|
||||||
context.setHeaders.push({ key: 'token', value: encode(decoded.gradidoID) })
|
context.setHeaders.push({ key: 'token', value: await encode(decoded.gradidoID) })
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -185,7 +185,7 @@ export class UserResolver {
|
|||||||
|
|
||||||
context.setHeaders.push({
|
context.setHeaders.push({
|
||||||
key: 'token',
|
key: 'token',
|
||||||
value: encode(dbUser.gradidoID),
|
value: await encode(dbUser.gradidoID),
|
||||||
})
|
})
|
||||||
|
|
||||||
await EVENT_USER_LOGIN(dbUser)
|
await EVENT_USER_LOGIN(dbUser)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user