File tree Expand file tree Collapse file tree
packages/nextjs/src/server/actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,11 +130,14 @@ const signInAction = async (
130130 const organizationId : string | undefined = ( idToken [ 'user_org' ] || idToken [ 'organization_id' ] ) as
131131 | string
132132 | undefined ;
133- const expiresIn : number = signInResult [ 'expiresIn' ] as number ;
133+ const rawExpiresIn : unknown = signInResult [ 'expiresIn' ] ?? signInResult [ 'expires_in' ] ;
134+ const expiresIn : number = Number ( rawExpiresIn ) ;
135+ if ( isNaN ( expiresIn ) ) {
136+ throw new Error ( `[signInAction] Invalid expiresIn value received: ${ rawExpiresIn } ` ) ;
137+ }
134138 const config : AsgardeoNextConfig = await client . getConfiguration ( ) ;
135- const sessionCookieExpiryTime : number = SessionManager . resolveSessionCookieExpiry (
136- config . sessionCookieExpiryTime ,
137- ) ;
139+ const sessionCookieExpiryTime : number =
140+ SessionManager . resolveSessionCookieExpiry ( config . sessionCookieExpiryTime ) ;
138141
139142 const sessionToken : string = await SessionManager . createSessionToken (
140143 accessToken ,
You can’t perform that action at this time.
0 commit comments