1
- import type { PendingSessionOptions , UseSessionReturn } from '@clerk/types' ;
1
+ import type { UseSessionReturn } from '@clerk/types' ;
2
2
3
3
import { eventMethodCalled } from '../../telemetry/events/method-called' ;
4
4
import { useAssertWrappedByClerkProvider , useClerkInstanceContext , useSessionContext } from '../contexts' ;
5
5
6
- type UseSession = ( options ?: PendingSessionOptions ) => UseSessionReturn ;
6
+ type UseSession = ( ) => UseSessionReturn ;
7
7
8
8
const hookName = `useSession` ;
9
9
/**
@@ -55,7 +55,7 @@ const hookName = `useSession`;
55
55
* </Tab>
56
56
* </Tabs>
57
57
*/
58
- export const useSession : UseSession = ( options = { } ) => {
58
+ export const useSession : UseSession = ( ) => {
59
59
useAssertWrappedByClerkProvider ( hookName ) ;
60
60
61
61
const session = useSessionContext ( ) ;
@@ -67,13 +67,9 @@ export const useSession: UseSession = (options = {}) => {
67
67
return { isLoaded : false , isSignedIn : undefined , session : undefined } ;
68
68
}
69
69
70
- const pendingAsSignedOut =
71
- session ?. status === 'pending' &&
72
- ( options . treatPendingAsSignedOut ?? clerk . __internal_getOption ( 'treatPendingAsSignedOut' ) ) ;
73
- const isSignedOut = session === null || pendingAsSignedOut ;
74
- if ( isSignedOut ) {
70
+ if ( session === null ) {
75
71
return { isLoaded : true , isSignedIn : false , session : null } ;
76
72
}
77
73
78
- return { isLoaded : true , isSignedIn : true , session } ;
74
+ return { isLoaded : true , isSignedIn : clerk . isSignedIn , session } ;
79
75
} ;
0 commit comments