1- import type { PendingSessionOptions , UseSessionReturn } from '@clerk/types' ;
1+ import type { UseSessionReturn } from '@clerk/types' ;
22
33import { eventMethodCalled } from '../../telemetry/events/method-called' ;
44import { useAssertWrappedByClerkProvider , useClerkInstanceContext , useSessionContext } from '../contexts' ;
55
6- type UseSession = ( options ?: PendingSessionOptions ) => UseSessionReturn ;
6+ type UseSession = ( ) => UseSessionReturn ;
77
88const hookName = `useSession` ;
99/**
@@ -55,7 +55,7 @@ const hookName = `useSession`;
5555 * </Tab>
5656 * </Tabs>
5757 */
58- export const useSession : UseSession = ( options = { } ) => {
58+ export const useSession : UseSession = ( ) => {
5959 useAssertWrappedByClerkProvider ( hookName ) ;
6060
6161 const session = useSessionContext ( ) ;
@@ -67,13 +67,9 @@ export const useSession: UseSession = (options = {}) => {
6767 return { isLoaded : false , isSignedIn : undefined , session : undefined } ;
6868 }
6969
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 ) {
7571 return { isLoaded : true , isSignedIn : false , session : null } ;
7672 }
7773
78- return { isLoaded : true , isSignedIn : true , session } ;
74+ return { isLoaded : true , isSignedIn : clerk . isSignedIn , session } ;
7975} ;
0 commit comments