From 98eaf787a5a859017b0410361b53bb7120c6ab78 Mon Sep 17 00:00:00 2001 From: joel Date: Thu, 10 Oct 2024 20:14:48 +0200 Subject: [PATCH] fix: update error messages --- src/GoTrueClient.ts | 1 - src/lib/helpers.ts | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GoTrueClient.ts b/src/GoTrueClient.ts index 352ca2e2..c80f0283 100644 --- a/src/GoTrueClient.ts +++ b/src/GoTrueClient.ts @@ -95,7 +95,6 @@ import type { UserIdentity, SignInAnonymouslyCredentials, AuthenticatorTransportFuture, - RegistrationCredential, PublicKeyCredentialCreationOptionsJSON, RegistrationResponseJSON, AuthenticationCredential, diff --git a/src/lib/helpers.ts b/src/lib/helpers.ts index e2491cd5..85038a08 100644 --- a/src/lib/helpers.ts +++ b/src/lib/helpers.ts @@ -488,7 +488,9 @@ export async function startRegistration( optionsJSON: PublicKeyCredentialCreationOptionsJSON ): Promise { if (!browserSupportsWebAuthn()) { - throw new Error('WebAuthn is not supported in this browser') + throw new Error( + 'WebAuthn is not supported in this browser. If using in SSR please use this in client components or pages.' + ) } // We need to convert some values to Uint8Arrays before passing the credentials to the navigator @@ -580,7 +582,9 @@ export async function startAuthentication( optionsJSON: PublicKeyCredentialRequestOptionsJSON ): Promise { if (!browserSupportsWebAuthn()) { - throw new Error('WebAuthn is not supported in this browser') + throw new Error( + 'WebAuthn is not supported in this browser. If using in SSR please use this in client components or pages.' + ) } // We need to avoid passing empty array to avoid blocking retrieval