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 =
|
const mfa_scope =
|
||||||
profile?.amr ==
|
profile?.amr ==
|
||||||
"urn:se:curity:authentication:otp-authenticator:OTP-Authenticator_web"
|
"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 {
|
return {
|
||||||
access_token: account.access_token,
|
access_token: account.access_token,
|
||||||
expires_at: account.expires_at
|
expires_at: tokenExpiry,
|
||||||
? account.expires_at * 1000
|
|
||||||
: undefined,
|
|
||||||
refresh_token: account.refresh_token,
|
refresh_token: account.refresh_token,
|
||||||
loginType,
|
loginType,
|
||||||
mfa_scope: mfa_scope,
|
mfa_scope: mfa_scope,
|
||||||
|
|||||||
Reference in New Issue
Block a user