Authentication Controllers
SignInController
Handles user login and authentication. Location:apps/web/app/auth/controllers/sign_in_controller.ts
show()
show()
Renders the sign-in page.Returns: Inertia render of
auth/sign_inhandle()
handle()
Processes login credentials and authenticates the user.Features:Returns: Redirects to return URL or after-auth route
- Rate limiting (5 requests per minute)
- Blocks IPs for 1 minute after limit exceeded
- Validates credentials using
signInValidator - Supports safe return-to URLs after authentication
- Session regeneration for security
- Email: required, valid email format
- Password: required, minimum 1 character
SignUpController
Handles new user registration. Location:apps/web/app/auth/controllers/sign_up_controller.ts
show()
show()
Renders the registration page.Returns: Inertia render of
auth/sign_uphandle()
handle()
Creates a new user account and logs them in.Validation:
- Full Name: 3-255 characters
- Email: unique, valid format, lowercase
- Password: requires confirmation
ForgotPasswordController
Initiates password reset flow. Location:apps/web/app/auth/controllers/forgot_password_controller.ts
show()
show()
Renders the forgot password page.Returns: Inertia render of
auth/forgot_passwordhandle()
handle()
Generates a password reset token and sends email.Features:
- Prevents user enumeration (always shows success)
- Generates secure reset token via PasswordResetService
- Emits
auth:forgot_passwordevent for email sending - Includes i18n translations for email content
ResetPasswordController
Completes password reset with token. Location:apps/web/app/auth/controllers/reset_password_controller.ts
show()
show()
Validates reset token and renders password reset page.Parameters:
params.token- Password reset token from URL
- Checks token exists
- Verifies token hasn’t expired
auth/reset_password or redirect to forgot password on errorhandle()
handle()
Updates user password with new credentials.Features:
- Validates reset token
- Updates user password (automatically hashed)
- Deletes all reset tokens for the user
- Clears rate limits for the user
User Management Controllers
UsersController
CRUD operations for user management. Location:apps/web/app/users/controllers/users_controller.ts
index()
index()
Lists users with search and filtering.Authorization: Requires
viewList permission via UserPolicyQuery Parameters:q- Search by name or email (case-insensitive)roleIds- Filter by role IDspage- Page number (default: 1)perPage- Results per page (default: 10)
- Pagination support
- Full-text search on name and email
- Role filtering
- Pre-computes avatar URLs
- Preloads role relationships
store()
store()
Creates a new user.Authorization: Requires
create permissionValidation:- Full Name: 3-255 characters
- Email: unique, valid format
- Role ID: must exist in roles table
- Password: optional, generates CUID if not provided
update()
update()
Updates an existing user.Authorization: Requires
update permission for specific userParameters:params.id- User ID to update
- Only updates provided fields
- Password is optional (keeps existing if not provided)
- Email uniqueness check excludes current user
destroy()
destroy()
Deletes a user.Authorization: Requires
delete permission for specific userParameters:params.id- User ID to delete
ProfileController
Manages authenticated user’s profile. Location:apps/web/app/users/controllers/profile_controller.ts
show()
show()
Displays the current user’s profile.Features:
- Pre-computes avatar URLs
- Returns user data via UserDto
users/profilehandle()
handle()
Updates the current user’s profile.Validation:
- Full Name: 3-255 characters
- Avatar: PNG, JPG, JPEG, or GIF (max 1MB)
- File upload support for avatars
- Creates attachment with variant processing
- Uses attachment manager for storage
PasswordController
Manages password changes for authenticated users. Location:apps/web/app/users/controllers/password_controller.ts
show()
show()
Renders the password change page.Returns: Inertia render of
users/passwordhandle()
handle()
Updates the user’s password.Validation:
- Password: 1-255 characters, requires confirmation
TokensController
Manages API access tokens for users. Location:apps/web/app/users/controllers/tokens_controller.ts
index()
index()
Lists all access tokens for the current user.Authorization: Requires
viewList permission via TokenPolicyReturns: Inertia render with token liststore()
store()
Creates a new API access token.Authorization: Requires
create permissionValidation:- Name: 3-255 characters (optional, defaults to “Secret Token”)
destroy()
destroy()
Deletes an API access token.Parameters:
params.id- Token ID to delete
Common Patterns
- Validation
- Inertia Responses
- Redirects