@@ -10,7 +10,7 @@ import { addClerkPrefix, isAbsoluteUrl, stripScheme } from '@clerk/shared/url';
10
10
import { handleValueOrFn , noop } from '@clerk/shared/utils' ;
11
11
import type {
12
12
__internal_UserVerificationModalProps ,
13
- ActiveSessionResource ,
13
+ AuthenticatedSessionResource ,
14
14
AuthenticateWithCoinbaseWalletParams ,
15
15
AuthenticateWithGoogleOneTapParams ,
16
16
AuthenticateWithMetamaskParams ,
@@ -164,7 +164,7 @@ export class Clerk implements ClerkInterface {
164
164
} ;
165
165
166
166
public client : ClientResource | undefined ;
167
- public session : ActiveSessionResource | null | undefined ;
167
+ public session : AuthenticatedSessionResource | null | undefined ;
168
168
public organization : OrganizationResource | null | undefined ;
169
169
public user : UserResource | null | undefined ;
170
170
public __internal_country ?: string | null ;
@@ -385,7 +385,7 @@ export class Clerk implements ClerkInterface {
385
385
} ) ;
386
386
} ;
387
387
388
- if ( ! opts . sessionId || this . client . activeSessions . length === 1 ) {
388
+ if ( ! opts . sessionId || this . client . authenticatedSessions . length === 1 ) {
389
389
if ( this . #options. experimental ?. persistClient ?? true ) {
390
390
await this . client . removeSessions ( ) ;
391
391
} else {
@@ -395,7 +395,7 @@ export class Clerk implements ClerkInterface {
395
395
return handleSetActive ( ) ;
396
396
}
397
397
398
- const session = this . client . activeSessions . find ( s => s . id === opts . sessionId ) ;
398
+ const session = this . client . authenticatedSessions . find ( s => s . id === opts . sessionId ) ;
399
399
const shouldSignOutCurrent = session ?. id && this . session ?. id === session . id ;
400
400
await session ?. remove ( ) ;
401
401
if ( shouldSignOutCurrent ) {
@@ -846,12 +846,12 @@ export class Clerk implements ClerkInterface {
846
846
: noop ;
847
847
848
848
if ( typeof session === 'string' ) {
849
- session = ( this . client . sessions . find ( x => x . id === session ) as ActiveSessionResource ) || null ;
849
+ session = ( this . client . sessions . find ( x => x . id === session ) as AuthenticatedSessionResource ) || null ;
850
850
}
851
851
852
852
let newSession = session === undefined ? this . session : session ;
853
853
854
- // At this point, the `session` variable should contain either an `ActiveSessionResource `
854
+ // At this point, the `session` variable should contain either an `AuthenticatedSessionResource `
855
855
// ,`null` or `undefined`.
856
856
// We now want to set the last active organization id on that session (if it exists).
857
857
// However, if the `organization` parameter is not given (i.e. `undefined`), we want
@@ -889,7 +889,7 @@ export class Clerk implements ClerkInterface {
889
889
// Note that this will also update the session's active organization
890
890
// id.
891
891
if ( inActiveBrowserTab ( ) || ! this . #options. standardBrowser ) {
892
- await this . #touchLastActiveSession ( newSession ) ;
892
+ await this . #touchCurrentSession ( newSession ) ;
893
893
// reload session from updated client
894
894
newSession = this . #getSessionFromClient( newSession ?. id ) ;
895
895
}
@@ -1983,14 +1983,14 @@ export class Clerk implements ClerkInterface {
1983
1983
this . #emit( ) ;
1984
1984
} ;
1985
1985
1986
- #defaultSession = ( client : ClientResource ) : ActiveSessionResource | null => {
1986
+ #defaultSession = ( client : ClientResource ) : AuthenticatedSessionResource | null => {
1987
1987
if ( client . lastActiveSessionId ) {
1988
1988
const lastActiveSession = client . activeSessions . find ( s => s . id === client . lastActiveSessionId ) ;
1989
1989
if ( lastActiveSession ) {
1990
1990
return lastActiveSession ;
1991
1991
}
1992
1992
}
1993
- const session = client . activeSessions [ 0 ] ;
1993
+ const session = client . authenticatedSessions [ 0 ] ;
1994
1994
return session || null ;
1995
1995
} ;
1996
1996
@@ -2006,7 +2006,7 @@ export class Clerk implements ClerkInterface {
2006
2006
}
2007
2007
this . #touchThrottledUntil = Date . now ( ) + 5_000 ;
2008
2008
2009
- void this . #touchLastActiveSession ( this . session ) ;
2009
+ void this . #touchCurrentSession ( this . session ) ;
2010
2010
}
2011
2011
} ) ;
2012
2012
@@ -2018,7 +2018,7 @@ export class Clerk implements ClerkInterface {
2018
2018
} ;
2019
2019
2020
2020
// TODO: Be more conservative about touches. Throttle, don't touch when only one user, etc
2021
- #touchLastActiveSession = async ( session ?: ActiveSessionResource | null ) : Promise < void > => {
2021
+ #touchCurrentSession = async ( session ?: AuthenticatedSessionResource | null ) : Promise < void > => {
2022
2022
if ( ! session || ! this . #options. touchSession ) {
2023
2023
return Promise . resolve ( ) ;
2024
2024
}
@@ -2068,14 +2068,14 @@ export class Clerk implements ClerkInterface {
2068
2068
) ;
2069
2069
} ;
2070
2070
2071
- #setAccessors = ( session ?: ActiveSessionResource | null ) => {
2071
+ #setAccessors = ( session ?: AuthenticatedSessionResource | null ) => {
2072
2072
this . session = session || null ;
2073
2073
this . organization = this . #getLastActiveOrganizationFromSession( ) ;
2074
2074
this . #aliasUser( ) ;
2075
2075
} ;
2076
2076
2077
- #getSessionFromClient = ( sessionId : string | undefined ) : ActiveSessionResource | null => {
2078
- return this . client ?. activeSessions . find ( x => x . id === sessionId ) || null ;
2077
+ #getSessionFromClient = ( sessionId : string | undefined ) : AuthenticatedSessionResource | null => {
2078
+ return this . client ?. authenticatedSessions . find ( x => x . id === sessionId ) || null ;
2079
2079
} ;
2080
2080
2081
2081
#aliasUser = ( ) => {
0 commit comments