ConstReadonlyUSER_CANCELLED: "USER_CANCELLED"User actively cancelled the authentication flow
ReadonlyACCESS_DENIED: "ACCESS_DENIED"Authentication was denied by user or Auth0 (rules, actions, policies)
ReadonlyNETWORK_ERROR: "NETWORK_ERROR"Network error occurred during authentication
ReadonlyID_TOKEN_VALIDATION_FAILED: "ID_TOKEN_VALIDATION_FAILED"ID token validation failed (signature, issuer, audience, nonce)
ReadonlyBIOMETRICS_CONFIGURATION_ERROR: "BIOMETRICS_CONFIGURATION_ERROR"Biometric configuration error
ReadonlyBROWSER_NOT_AVAILABLE: "BROWSER_NOT_AVAILABLE"No compatible browser available on device
ReadonlyFAILED_TO_LOAD_URL: "FAILED_TO_LOAD_URL"Authorization URL failed to load in browser
ReadonlyBROWSER_TERMINATED: "BROWSER_TERMINATED"Browser was closed unexpectedly
ReadonlyNO_BUNDLE_IDENTIFIER: "NO_BUNDLE_IDENTIFIER"Native bundle identifier could not be retrieved (iOS)
ReadonlyTRANSACTION_ACTIVE_ALREADY: "TRANSACTION_ACTIVE_ALREADY"Another authentication transaction is already active
ReadonlyNO_AUTHORIZATION_CODE: "NO_AUTHORIZATION_CODE"Authorization code missing from callback URL
ReadonlyPKCE_NOT_ALLOWED: "PKCE_NOT_ALLOWED"PKCE is required but not enabled in Auth0 Application
ReadonlyINVALID_INVITATION_URL: "INVALID_INVITATION_URL"Organization invitation URL is malformed
ReadonlyINVALID_STATE: "INVALID_STATE"State parameter mismatch (potential CSRF attack)
ReadonlyTIMEOUT_ERROR: "TIMEOUT_ERROR"Authentication flow timed out
ReadonlyCONSENT_REQUIRED: "CONSENT_REQUIRED"User consent required for requested scopes
ReadonlyINVALID_CONFIGURATION: "INVALID_CONFIGURATION"Auth0 Application is misconfigured
ReadonlyUNKNOWN_ERROR: "UNKNOWN_ERROR"Unknown or uncategorized error
import { WebAuthError, WebAuthErrorCodes } from 'react-native-auth0';
try {
await auth0.webAuth.authorize();
} catch (e) {
if (e instanceof WebAuthError) {
switch (e.type) {
case WebAuthErrorCodes.USER_CANCELLED:
// User cancelled the authentication
break;
case WebAuthErrorCodes.NETWORK_ERROR:
// Network connectivity issue
break;
}
}
}
Platform-agnostic error code constants for WebAuth operations.
Use these constants for type-safe error handling when working with WebAuth errors. Each constant corresponds to a specific error type in the WebAuthError.type property.