Overview
SaaS Starter Vue uses Laravel Fortify for authentication, providing:- Email/password login
- User registration
- Password reset via email
- Email verification
- Two-factor authentication (2FA)
- Password confirmation
Authentication works on both central and tenant domains with isolated user databases.
Authentication Features
Fortify features are configured inconfig/fortify.php:
Login
Central Domain Login
System administrators log in at the central domain:1
Visit Login Page
Navigate to
/auth/login on the central domain2
Enter Credentials
Provide your email and password
3
Two-Factor (if enabled)
Enter your 2FA code if two-factor authentication is enabled
4
Redirect to Dashboard
Successfully authenticated users are redirected to
/dashboardTenant Domain Login
Tenant users log in at their subdomain:Tenant authentication is completely isolated. Users cannot log in to the central domain with tenant credentials and vice versa.
Rate Limiting
Login attempts are throttled to prevent brute force attacks:Registration
User Registration
New users can register if the registration feature is enabled:Guest Tenant Registration
Prospective customers can create their own tenant workspace:1
Fill Registration Form
Provide company name, subdomain, owner details, and password
2
Tenant Provisioning
System automatically creates tenant database and domain
3
Admin User Creation
Owner account is created with admin privileges
4
Redirect to Tenant
User is redirected to their new tenant subdomain login page
Password Reset
Request Password Reset
Users can request a password reset link via email:Reset Password Flow
1
Request Reset Link
User enters their email at
/auth/forgot-password2
Email Sent
System sends password reset link to the user’s email
3
Click Reset Link
User clicks the link in their email
4
Set New Password
User enters and confirms their new password
5
Password Updated
Password is updated and user can log in with new credentials
Email Verification
Verification Required
Many routes require email verification:Verification Process
1
User Registers
New user creates an account
2
Verification Email Sent
System automatically sends verification email
3
Click Verification Link
User clicks the link in their email
4
Email Verified
User’s email is marked as verified and they gain full access
Resend Verification Email
Users can request a new verification email:User Model
The User model includes authentication traits:Password Hashing
Passwords are automatically hashed using thepassword cast:
Profile Management
Update Profile Information
Users can update their name and email:Update Password
Authenticated users can change their password:Password Confirmation
Sensitive operations require password confirmation:password.confirm middleware on sensitive routes:
Logout
Users can log out from both central and tenant domains:Configuration
Fortify Settings
Key configuration options inconfig/fortify.php:
string
default:"web"
The authentication guard to use
string
default:"users"
Password broker for reset functionality
string
default:"email"
Field used for authentication (email)
string
default:"/dashboard"
Redirect path after successful authentication
boolean
default:"true"
Enable view routes for authentication pages
Customizing Redirects
Change the post-login redirect:Security Best Practices
- Use Strong Passwords - Enforce password requirements with validation rules
- Enable 2FA - Require two-factor authentication for admin accounts
- Rate Limiting - Prevents brute force attacks (enabled by default)
- Email Verification - Verify user email addresses before granting full access
- HTTPS Only - Never transmit credentials over unencrypted connections
- Password Hashing - Laravel uses bcrypt by default (secure)
Testing Authentication
Use Laravel’s testing helpers:Common Issues
Users can't receive password reset emails
Users can't receive password reset emails
Check your mail configuration in
.env. For local development, use a service like Mailtrap or Laravel’s log mail driver:Login redirects to wrong domain
Login redirects to wrong domain
For tenant logins, ensure you’re using the correct login route (
tenant.login) instead of the central domain route.Rate limiting blocking legitimate users
Rate limiting blocking legitimate users
Adjust rate limiting in
config/fortify.php or clear rate limits manually during development.