Server-Side Setup
1. Configure BetterAuth
Client-Side Implementation
1. Forgot Password Form
2. Reset Password Form
Password Reset Flow
1. Forgot Password Flow
- User clicks “Forgot Password” link
- User enters email address
- System validates email
- Send reset password email
- User receives email with reset link
2. Reset Password Flow
- User clicks reset link in email
- User enters new password
- System validates password
- Update password
- Sign in user with new password
- Redirect to dashboard
Security Features
-
Token Security
- Secure token generation
- Token expiration (1 hour)
- One-time use tokens
- Rate limiting
-
Password Security
- Password complexity requirements
- Password confirmation
- Secure password hashing
- Rate limiting
-
Email Security
- Secure email delivery
- Email verification
- Spam protection
Best Practices
-
Error Handling
- Show user-friendly error messages
- Log password reset attempts
- Handle edge cases
- Provide clear feedback
-
User Experience
- Clear form validation
- Loading states
- Success/error feedback
- Clear instructions
-
Security
- HTTPS in production
- Rate limiting
- Input validation
- Token validation
Common Issues & Solutions
-
Email Not Received
- Check spam folder
- Verify email address
- Check rate limits
- Resend reset email
-
Link Expired
- Request new reset link
- Clear browser cache
- Check system time
- Handle expired tokens
-
Invalid Token
- Request new reset link
- Clear browser cache
- Check URL encoding
- Handle invalid tokens