Password-Based Authentication
LoginForm
A form component for email and password authentication.Props
This component has no props. It manages its own state internally.State Management
The component usesuseAuthActions from @convex-dev/auth/react to access the signIn method.
Internal State
User’s email address for authentication
User’s password for authentication
Error message to display if authentication fails
Loading state during authentication process
Behavior
Submits authentication withflow: "signIn" to the Convex Auth password provider.
Example
SignUpForm
A form component for user registration with email and password.Props
This component has no props. It manages its own state internally.State Management
The component usesuseAuthActions from @convex-dev/auth/react to access the signIn method and useRouter from next/navigation for navigation.
Internal State
User’s display name
User’s email address
User’s password (minimum 8 characters)
Password confirmation field
Error message to display if registration fails
Loading state during registration process
Validation
- Passwords must match
- Password must be at least 8 characters
- Email must be valid email format
Behavior
Submits registration withflow: "signUp" to the Convex Auth password provider. On success, redirects to /auth/sign-up-success.
Example
ForgotPasswordForm
A form component for initiating password reset flow.Props
This component has no props. It manages its own state internally.State Management
The component usesuseAuthActions from @convex-dev/auth/react to access the signIn method and useRouter from next/navigation for navigation.
Internal State
User’s email address to send reset code
Error message to display if request fails
Success state after code is sent
Loading state during request process
Behavior
Submits password reset request withflow: "reset" to trigger the ResendOTPPasswordReset provider. Sends an 8-digit OTP code via email. On success, displays success message and button to proceed to update password page.
Example
UpdatePasswordForm
A form component for completing password reset with OTP code.Props
This component has no props. It reads email from URL search parameters if available.State Management
The component uses:useAuthActionsfrom@convex-dev/auth/reactto access thesignInmethoduseRouteranduseSearchParamsfromnext/navigationfor navigation and URL parameters
Internal State
User’s email address (can be pre-filled from URL parameter)
8-digit verification code received via email
New password (minimum 8 characters)
Password confirmation field
Error message to display if update fails
Loading state during update process
Validation
- Email is required
- Code must be provided (8 digits)
- Passwords must match
- Password must be at least 8 characters
Behavior
Submits password update withflow: "reset-verification" including the code, email, and new password. On success, redirects to /auth/login?message=password-updated.
Example
LogoutButton
A button component for signing out users.Props
Whether to display the logout icon
Button text content
All other Button component props are supported
State Management
The component usesuseAuthActions from @convex-dev/auth/react to access the signOut method.
Example
Social Authentication
SocialLoginForm
A form component for OAuth authentication with social providers.Props
Array of OAuth providers to display. Supported values:
"github", "google"Types
State Management
The component usesuseAuthActions from @convex-dev/auth/react to access the signIn method.
Internal State
Error message to display if authentication fails
Tracks which provider is currently being used for authentication
Behavior
Initiates OAuth flow by callingsignIn(provider) where provider is the selected OAuth provider (e.g., “github” or “google”).