feat(SW-162): MFA expiry set with token expiry
This commit is contained in:
9
auth.ts
9
auth.ts
@@ -109,12 +109,13 @@ export const config = {
|
||||
const mfa_scope =
|
||||
profile?.amr ==
|
||||
"urn:se:curity:authentication:otp-authenticator:OTP-Authenticator_web"
|
||||
const mfa_expires_at = mfa_scope ? Date.now() + 10 * 60 * 1000 : 0
|
||||
const tokenExpiry = account.expires_at
|
||||
? account.expires_at * 1000
|
||||
: undefined
|
||||
const mfa_expires_at = mfa_scope && tokenExpiry ? tokenExpiry : 0
|
||||
return {
|
||||
access_token: account.access_token,
|
||||
expires_at: account.expires_at
|
||||
? account.expires_at * 1000
|
||||
: undefined,
|
||||
expires_at: tokenExpiry,
|
||||
refresh_token: account.refresh_token,
|
||||
loginType,
|
||||
mfa_scope: mfa_scope,
|
||||
|
||||
Reference in New Issue
Block a user