Skip to content

Commit 798ee78

Browse files
committed
Add guard for user
1 parent 64cc65c commit 798ee78

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/clerk-js/src/core/clerk.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ import type {
7474
AuthenticateWithSolanaParams,
7575
BillingNamespace,
7676
CheckoutSignalValue,
77-
Clerk as ClerkInterface,
7877
ClerkAPIError,
7978
ClerkAuthenticateWithWeb3Params,
79+
Clerk as ClerkInterface,
8080
ClerkOptions,
8181
ClientJSONSnapshot,
8282
ClientResource,
@@ -1457,6 +1457,15 @@ export class Clerk implements ClerkInterface {
14571457
return;
14581458
}
14591459

1460+
if (noUserExists(this)) {
1461+
if (this.#instanceType === 'development') {
1462+
throw new ClerkRuntimeError(warnings.cannotOpenCheckout, {
1463+
code: CANNOT_RENDER_USER_MISSING_ERROR_CODE,
1464+
});
1465+
}
1466+
return;
1467+
}
1468+
14601469
this.assertComponentsReady(this.#clerkUI);
14611470
const component = 'ConfigureSSO';
14621471
void this.#clerkUI

0 commit comments

Comments
 (0)