Skip to content

Commit

Permalink
fix: update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Oct 10, 2024
1 parent 28cb248 commit 98eaf78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ import type {
UserIdentity,
SignInAnonymouslyCredentials,
AuthenticatorTransportFuture,
RegistrationCredential,
PublicKeyCredentialCreationOptionsJSON,
RegistrationResponseJSON,
AuthenticationCredential,
Expand Down
8 changes: 6 additions & 2 deletions src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ export async function startRegistration(
optionsJSON: PublicKeyCredentialCreationOptionsJSON
): Promise<RegistrationResponseJSON> {
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
Expand Down Expand Up @@ -580,7 +582,9 @@ export async function startAuthentication(
optionsJSON: PublicKeyCredentialRequestOptionsJSON
): Promise<AuthenticationResponseJSON> {
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
Expand Down

0 comments on commit 98eaf78

Please sign in to comment.