Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85dec76

Browse files
committed
Rollback to __internal_getOption
1 parent d727d7d commit 85dec76

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/react/src/hooks/useAuth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { createCheckAuthorization, resolveAuthState } from '@clerk/shared/authorization';
2-
import { useOptionsContext } from '@clerk/shared/react';
32
import type {
43
CheckAuthorizationWithCustomPermissions,
54
GetToken,
@@ -144,8 +143,9 @@ export const useAuth = (initialAuthStateOrOptions: UseAuthOptions = {}): UseAuth
144143
* ```
145144
*/
146145
export function useDerivedAuth(authObject: any, options: PendingSessionOptions = {}): UseAuthReturn {
147-
const optionsContext = useOptionsContext();
148-
const treatPendingAsSignedOut = options.treatPendingAsSignedOut ?? optionsContext?.treatPendingAsSignedOut;
146+
const clerk = useIsomorphicClerkContext();
147+
const treatPendingAsSignedOut =
148+
options.treatPendingAsSignedOut ?? clerk.__internal_getOption('treatPendingAsSignedOut') ?? true;
149149

150150
const { userId, orgId, orgRole, has, signOut, getToken, orgPermissions, factorVerificationAge } = authObject ?? {};
151151

@@ -173,7 +173,7 @@ export function useDerivedAuth(authObject: any, options: PendingSessionOptions =
173173
has: derivedHas,
174174
},
175175
options: {
176-
treatPendingAsSignedOut: treatPendingAsSignedOut ?? options.treatPendingAsSignedOut ?? true,
176+
treatPendingAsSignedOut,
177177
},
178178
});
179179

packages/vue/src/composables/useAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export const useAuth: UseAuth = ({ treatPendingAsSignedOut } = {}) => {
117117
},
118118
options: {
119119
treatPendingAsSignedOut:
120-
treatPendingAsSignedOut ?? clerk.value?.__internal_getOption('treatPendingAsSignedOut'),
120+
treatPendingAsSignedOut ?? clerk.value?.__internal_getOption('treatPendingAsSignedOut') ?? true,
121121
},
122122
});
123123

0 commit comments

Comments
 (0)