From 29bb257419e3af9f481fa440e36dbb86aecc969c Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 6 Dec 2023 11:57:41 +0200 Subject: [PATCH] fix(clerk-react): Utility `has` returns false when user isLoaded is true and no user or org --- packages/react/src/hooks/useAuth.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/hooks/useAuth.ts b/packages/react/src/hooks/useAuth.ts index 3781db518c..b8e60b3d1e 100644 --- a/packages/react/src/hooks/useAuth.ts +++ b/packages/react/src/hooks/useAuth.ts @@ -14,7 +14,7 @@ import { errorThrower } from '../utils'; import { createGetToken, createSignOut } from './utils'; type CheckAuthorizationSignedOut = undefined; -type CheckAuthorizationWithoutOrg = (params?: Parameters[0]) => false; +type CheckAuthorizationWithoutOrgOrUser = (params?: Parameters[0]) => false; type UseAuthReturn = | { @@ -39,7 +39,7 @@ type UseAuthReturn = orgId: null; orgRole: null; orgSlug: null; - has: CheckAuthorizationSignedOut; + has: CheckAuthorizationWithoutOrgOrUser; signOut: SignOut; getToken: GetToken; } @@ -52,7 +52,7 @@ type UseAuthReturn = orgId: null; orgRole: null; orgSlug: null; - has: CheckAuthorizationWithoutOrg; + has: CheckAuthorizationWithoutOrgOrUser; signOut: SignOut; getToken: GetToken; } @@ -164,7 +164,7 @@ export const useAuth: UseAuth = () => { orgId: null, orgRole: null, orgSlug: null, - has: undefined, + has: () => false, signOut, getToken, };