Components
<AuthUIProvider>
The <AuthUIProvider>
wraps your application with authentication context, providing essential hooks, settings, and methods required by authentication-related components and hooks throughout your app.
Usage
Reference
The following props can be passed to the <AuthUIProvider>
component:
Prop | Type | Default |
---|---|---|
authClient | AuthClient | Required |
viewPaths? | AuthViewPaths | authViewPaths |
localization? | AuthLocalization | authLocalization |
additionalFields? | AdditionalFields | - |
avatar? | boolean | false |
avatarExtension? | string | "png" |
avatarSize? | number | 128 | 256 |
basePath? | string | "/auth" |
colorIcons? | boolean | false |
credentials? | boolean | true |
defaultRedirectTo? | string | "/" |
deleteAccountVerification? | boolean | false |
deleteUser? | boolean | false |
emailVerification? | boolean | - |
forgotPassword? | boolean | false |
freshAge? | number | 60 * 60 * 24 |
magicLink? | boolean | false |
multiSession? | boolean | false |
nameRequired? | boolean | true |
noColorIcons? | boolean | false |
optimistic? | boolean | false |
passkey? | boolean | false |
persistClient? | boolean | false |
providers? | SocialProvider[] | - |
rememberMe? | boolean | false |
settingsFields? | string[] | ["name"] |
settingsUrl? | string | - |
signUpFields? | string[] | ["name"] |
username? | boolean | false |
navigate? | (href: string) => void | window.location.href |
onSessionChange? | () => void | Promise<void> | - |
replace? | (href: string) => void | navigate |
uploadAvatar? | (file: File) => Promise<string> | - |
LinkComponent? | any | <a> |
Example
A minimal Next.js layout file using the AuthUIProvider
: