<UrAuth> component provides a beautiful, fully-functional authentication screen out of the box. It supports Email/Password login, Sign Up, Password Resets, and OAuth (Social Login).
Usage
Simply drop the component into your login page. It will automatically detect if the user is logging in or signing up, and communicate with your urBackend project.Props
| Prop | Type | Default | Description |
|---|---|---|---|
theme | 'light' | 'dark' | 'light' | Visual theme mode (ThemeMode internally). |
providers | ('google' | 'github')[] | { google?: boolean; github?: boolean; emailPassword?: boolean } | ['google', 'github'] | Auth methods to show. Supports legacy array form and v0.2.0 object form. |
enableEmailPassword | boolean | true | Top-level shorthand to enable/disable email/password auth. |
colors | Partial<AuthColors> | undefined | Overrides for auth widget theme colors. |
branding | AuthBranding | undefined | Branding/white-label configuration (logo, app name, subtitle, brand color). |
labels | Partial<AuthLabels> | undefined | Text/copy overrides for tabs, titles, buttons, and footer prompts. |
hideSignup | boolean | false | Hides the sign up tab and sign up footer toggle when true. |
onSuccess | () => void | undefined | Called after successful sign-in or sign-up flow. |
All customization props are optional. If omitted, <UrAuth> falls back to the same default behavior/UI style as v0.1.x.
providers and enableEmailPassword
providers now accepts either:
Example: Email/password only
Example: Google only
Example: Disable all methods
No authentication methods are enabled for this screen. message.
enableEmailPassword interaction
enableEmailPasswordis a shorthand global toggle.- When
providersis an object and includesemailPassword, that object value takes precedence. - If
providers.emailPasswordis omitted,enableEmailPasswordis used.
colors theme customization
Use colors to override theme tokens:
colors.primaryColor and branding.primaryColor are provided, branding.primaryColor takes precedence.
branding white-label options
labels text overrides (with aliases)
Supported label keys:
- Tabs:
loginTab(signInTabalias),signupTab(signUpTabalias) - Titles:
loginTitle(signInTitlealias),signupTitle(signUpTitlealias),forgotTitle,resetTitle,forgotSubtitle,resetSubtitle - Buttons:
loginButton(signInButtonalias),signupButton(signUpButtonalias),forgotButton,resetButton,googleButton,githubButton - Field labels/placeholders:
emailLabel,emailPlaceholder,passwordLabel,passwordPlaceholder,nameLabel,namePlaceholder,otpLabel,otpPlaceholder - Footer/misc:
forgotPasswordLink,socialDivider,footerSigninPrompt,footerSignupPrompt,footerForgotPrompt,noAuthMethods
Full v0.2.0 customization example
Migration (v0.1.x → v0.2.0)
providersnow also accepts object form:{ google?, github?, emailPassword? }- Existing array usage (
['google', 'github']) still works - No breaking API changes otherwise
Behavior
- Email Login: Prompts the user for email and password. If successful, updates the global
UrProviderstate automatically. - Social Login: Redirects the user to the provider (e.g. Google). Upon successful login, the user is redirected to the
Site URLyou configured in your urBackend Dashboard settings. - Password Reset: Allows users to request an OTP and reset their password inline.
