# Auth Pages

Authentication pages for the application.

## Pages

### Login (`/auth/login`)
- Username/email + password authentication
- Captcha verification
- Two-factor authentication support
- Links to register and forgot password

### Register (`/auth/register`)
- Username, email, password registration
- Password confirmation
- Captcha verification
- Automatic personal workspace creation

### Forgot Password (`/auth/forgot-password`)
- Email-based password reset request
- Sends reset link to user's email

### Reset Password (`/auth/reset-password`)
- Token-based password reset
- Accessed via email link with `?token=...` parameter
- Password confirmation

### Change Password (`/auth/change-password`)
- Authenticated users can change password
- Requires current password verification
- Password confirmation

### Two-Factor Authentication (`/auth/two-factor`)
- Enable/disable 2FA
- QR code generation for authenticator apps
- Manual secret key entry option
- Verification code input

## Features

- Form validation with react-hook-form
- Error handling and user feedback
- Captcha integration with image refresh
- Responsive design with shadcn/ui components
- Type-safe API calls with generated client

## API Integration

All pages use the generated API client from `@/client/generated`:
- `apiAuthLogin`
- `apiAuthRegister`
- `apiAuthCaptcha`
- `apiUserRequestPasswordReset`
- `apiUserConfirmPasswordReset`
- `apiUserChangePassword`
- `api2faEnable`
- `api2faVerify`
- `api2faDisable`
- `api2faStatus`

## Usage

Import pages from `@/app/auth`:

```tsx
import {
  LoginPage,
  RegisterPage,
  ForgotPasswordPage,
  ResetPasswordPage,
  ChangePasswordPage,
  TwoFactorPage,
} from "@/app/auth";
```

## Routes

Configured in `App.tsx`:
- `/auth/login` - Login page
- `/auth/register` - Registration page
- `/auth/forgot-password` - Forgot password page
- `/auth/reset-password` - Reset password page (with token)
- `/auth/change-password` - Change password page (authenticated)
- `/auth/two-factor` - 2FA management page (authenticated)
