Admin Login Flow Test
Test the complete authentication flow for administrators
Environment Variables Check
Required variables for admin login to work
MAIL_FROMRequired
SENDGRID_API_KEYRequired
EMAIL_TOKEN_SECRETRequired
APP_BASE_URLRequired
Set these in Dashboard → Settings → Environment Variables
Test Admin Login
Enter an admin email address to test the complete login flow
Manual Testing Steps
- Create Admin User
Go to Admin Dashboard → Users & Access → Click "Invite Admin"
- Accept Invitation
Check email inbox → Click activation link → Account created
- Sign In
Go to /SignIn → Enter admin email → Click "Send Sign-In Link"
- Check Email
Open email → Click magic link (expires in 15 min)
- Verify Login
Should redirect to /admin automatically
Common Issues & Solutions
❌ Email not received
- • Check spam/junk folder
- • Verify SENDGRID_API_KEY and MAIL_FROM are set
- • Make sure sender email is verified in SendGrid
- • Check SendGrid dashboard for delivery logs
❌ Link expired
- • Magic links expire in 15 minutes
- • Request a new link from /SignIn page
❌ "Invalid token" error
- • Check EMAIL_TOKEN_SECRET is set in environment
- • Make sure token hasn't been used already
- • Verify token hasn't expired
