Testing: Authentication
Test the full auth flow: register, verify email, login, logout.
Demo Credentials
| Role | Password | Tenant | |
|---|---|---|---|
| Admin | daniel.harris@example.com | Demo1234! | demo-association |
| Member | demo@gmail.com | Demo1234! | demo-association |
Test 1: Login
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
- Go to https://ams.14.jugaar.ai/login
- Enter
daniel.harris@example.comas email - Enter
Demo1234!as password - Enter
demo-associationas tenant - Click Sign In
- ✅ You should see the Dashboard
curl -X POST https://ams.14.jugaar.ai/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "daniel.harris@example.com",
"password": "Demo1234!",
"tenant_id": "demo-association"
}'
Expected: 200 OK with access_token and user object.
Test 2: Register (New User)
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
- Click Get Started on the landing page
- Fill in:
- First Name:
Test - Last Name:
User - Email:
testuser@example.com - Tenant ID:
demo-association - Password:
MySecure123! - Confirm Password:
MySecure123!
- First Name:
- Click Create Account
- ✅ You should see "Check Your Email" screen
- Check your inbox for a verification email
- Click the verification link
- ✅ Email verified — go to login
# Register
curl -X POST https://ams.14.jugaar.ai/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"first_name": "Test",
"last_name": "User",
"email": "testuser@example.com",
"tenant_id": "demo-association",
"password": "MySecure123!",
"confirm_password": "MySecure123!"
}'
Expected: 201 Created
# Verify email (use token from email)
curl -X POST https://ams.14.jugaar.ai/api/v1/auth/verify-email \
-H "Content-Type: application/json" \
-d '{"token": "TOKEN_FROM_EMAIL"}'
Expected: 200 OK
Test 3: Get Current User
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
After login, your name and role appear in the top bar. No action needed — this is automatic.
curl -s https://ams.14.jugaar.ai/api/v1/auth/me \
-H "Authorization: Bearer $TOKEN"
Expected: 200 OK with user profile including roles.
Test 4: Email Verification Errors
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
- Try to login with an unverified account
- ✅ You should see an error: "Please verify your email before logging in"
- ✅ A "Resend verification email" button appears
- Click it to resend
# Try to login before verification (should fail)
curl -s -X POST https://ams.14.jugaar.ai/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "unverified@example.com",
"password": "SomePassword123!",
"tenant_id": "demo-association"
}'
Expected: 403 Forbidden with message about email verification.
# Resend verification
curl -X POST https://ams.14.jugaar.ai/api/v1/auth/resend-verification \
-H "Content-Type: application/json" \
-d '{"email": "unverified@example.com", "tenant_id": "demo-association"}'
Expected: 200 OK (generic message to prevent enumeration)
Test 5: Logout
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
- Click Logout in the sidebar
- ✅ You're back on the landing page
- ✅ The navbar shows "Sign In" instead of "Dashboard"
No server-side logout. Simply discard the token:
unset TOKEN
Test 6: Protected Routes
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
- Log out
- Try to go directly to
https://ams.14.jugaar.ai/dashboard - ✅ You should be redirected to the login page
# Try to access protected endpoint without token
curl -s -o /dev/null -w "%{http_code}" https://ams.14.jugaar.ai/api/v1/members/
Expected: 401 Unauthorized
Test 7: Password Validation
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
- Go to Register
- Try a weak password like
123 - ✅ You should see a clear error message about password requirements
# Try weak password
curl -s -X POST https://ams.14.jugaar.ai/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"first_name": "Test",
"last_name": "User",
"email": "weak@example.com",
"tenant_id": "demo-association",
"password": "123",
"confirm_password": "123"
}'
Expected: 422 Unprocessable Entity with validation error details.
Password requirements: uppercase, lowercase, special character, 8+ characters.
Summary
| Test | Easy Result | API Result |
|---|---|---|
| Login | Dashboard appears | 200 + token |
| Register | "Check Your Email" screen | 201 + user_id |
| Get User | Name in top bar | 200 + profile |
| Verify Errors | Error + resend button | 403 |
| Logout | Back to landing page | N/A |
| Protected Routes | Redirect to login | 401 |
| Password Validation | Clear error message | 422 |