Appearance
Forgot Password Page
File Information
- Path:
pages/forgot-password.vue - Route:
/forgot-password - Middleware:
guestCheck - Layout:
outerLayoutordefault
Purpose
The Forgot Password page allows users to request a password reset link via email. Users enter their email address, and if the email exists in the system, a password reset link is sent to their email address.
Key Features
Email Validation
- Validates email format using Vuelidate
- Shows error messages for invalid email
- Required field validation
Skeleton Loading
- Shows skeleton loaders during initial page load
- Improves perceived performance
Form Submission
- Sends password reset request to backend
- Shows loading state during submission
- Displays success/error messages
User Feedback
- Clear error messages
- Success confirmation
- Link to return to login page
Components Used
v-skeleton-loader- Loading skeleton componentsv-form- Form wrapper with validationv-text-field- Email input fieldv-btn- Submit button- Custom form styling components
Data Properties
javascript
{
contentLoading: boolean, // Initial content loading state
loading: boolean, // Form submission loading state
form: {
email: string // User email address
},
errors: {
email: string // Email validation error
}
}Validation Rules
Email Validation
- Required field
- Must be valid email format
- Uses Vuelidate for validation
javascript
validations: {
form: {
email: {
required,
email
}
}
}Computed Properties
emailErrorMessages- Returns email validation error messagesdisableSubmitBtn- Determines if submit button should be disabled based on validation state
Methods
handleSubmit()
Handles form submission:
- Validates form data using Vuelidate
- Checks if email is valid
- Calls password reset API endpoint
- Shows success message on success
- Shows error message on failure
- Handles loading state
validateEmail()
Validates email format:
- Uses utility function to validate email
- Sets error message if invalid
- Returns validation result
API Endpoints
POST /forgot-password- Request password reset link- Request Body:json
{ "email": "[email protected]" } - Response:json
{ "message": "Password reset link sent to your email", "status": "success" }
- Request Body:
User Flow
- User navigates to
/forgot-password - User enters email address
- Form validation occurs on blur/submit
- On submit:
- Loading state is shown
- API request is sent
- On success: Success message is displayed
- On error: Error message is displayed
- User receives email with reset link (if email exists)
- User can return to login page
Error Handling
- Invalid Email Format: Shows validation error message
- Email Not Found: Shows generic message (for security, doesn't reveal if email exists)
- Network Error: Shows error message with retry option
- Server Error: Shows error message
Styling
- Uses custom CSS classes:
signin-screen-body- Main containerform-group- Form field containerform-label- Label stylingform-controls- Input field stylingbtn-primary- Primary button stylingforgotLink- Link styling
Security Considerations
- Does not reveal if email exists in system (prevents email enumeration)
- Rate limiting on backend to prevent abuse
- CSRF protection via Nuxt.js
- Password reset links expire after a set time
Environment Variables
API_BASE_URL- Backend API base URLPASSWORD_RESET_EXPIRY- Password reset link expiration time
Notes for Development
- The page uses skeleton loaders for better UX during initial load
- Email validation uses Vuelidate for consistent validation
- Error messages are user-friendly and don't reveal system details
- The page redirects to login after successful submission
- Password reset links are time-limited for security
Related Documentation
- Login Page - Main login page
- Reset Password Page - Password reset page
- Middleware Documentation - Route protection
- Common Functions Mixin - Common utilities