Skip to content

Commit

Permalink
fix(clerk-react): Utility has returns false when user isLoaded is t…
Browse files Browse the repository at this point in the history
…rue and no user or org
  • Loading branch information
panteliselef committed Dec 6, 2023
1 parent cf736cc commit 29bb257
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/react/src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { errorThrower } from '../utils';
import { createGetToken, createSignOut } from './utils';

type CheckAuthorizationSignedOut = undefined;
type CheckAuthorizationWithoutOrg = (params?: Parameters<CheckAuthorizationWithCustomPermissions>[0]) => false;
type CheckAuthorizationWithoutOrgOrUser = (params?: Parameters<CheckAuthorizationWithCustomPermissions>[0]) => false;

type UseAuthReturn =
| {
Expand All @@ -39,7 +39,7 @@ type UseAuthReturn =
orgId: null;
orgRole: null;
orgSlug: null;
has: CheckAuthorizationSignedOut;
has: CheckAuthorizationWithoutOrgOrUser;
signOut: SignOut;
getToken: GetToken;
}
Expand All @@ -52,7 +52,7 @@ type UseAuthReturn =
orgId: null;
orgRole: null;
orgSlug: null;
has: CheckAuthorizationWithoutOrg;
has: CheckAuthorizationWithoutOrgOrUser;
signOut: SignOut;
getToken: GetToken;
}
Expand Down Expand Up @@ -164,7 +164,7 @@ export const useAuth: UseAuth = () => {
orgId: null,
orgRole: null,
orgSlug: null,
has: undefined,
has: () => false,
signOut,
getToken,
};
Expand Down

0 comments on commit 29bb257

Please sign in to comment.