All endpoints are prefixed with
/api/auth. Requests and responses use
Content-Type: application/json. Endpoints that require authentication expect
an Authorization: Bearer <accessToken> header.POST /api/auth/signup
Register a new user account. A verification OTP is automatically sent to the provided email address.Only
@calpoly.edu email addresses are accepted.Request body
A valid
@calpoly.edu email address.Account password. Must be 8–30 characters.
Display name shown on the user’s profile. Must be 2–30 characters.
Response — 201 Created
true on success.Human-readable confirmation, e.g.
"Account created. Please check your email for the verification code."Error responses
| Status | Condition |
|---|---|
400 | Missing or invalid fields, non-@calpoly.edu email, password/username length out of range |
409 | Email is already registered |
Example
POST /api/auth/login
Sign in with email and password. Returns Supabase session tokens and the user’s profile data.Request body
Registered email address.
Account password.
Response — 200 OK
true on success.Error responses
| Status | Condition |
|---|---|
400 | Missing email or password field |
401 | Invalid email or password |
Example
POST /api/auth/verify
Verify the OTP code that was emailed after signup. Returns session tokens on success, making the account active.Request body
Email address that received the OTP.
The OTP code from the verification email. Must be 4–8 characters.
Response — 200 OK
true on success."Email verified successfully."Error responses
| Status | Condition |
|---|---|
400 | Invalid or expired OTP code |
404 | User record not found after verification |
Example
POST /api/auth/resend
Resend the signup verification OTP to the provided email address.Request body
Email address to resend the verification code to.
Response — 200 OK
true on success."A new code has been sent to your email."Error responses
| Status | Condition |
|---|---|
400 | Missing email or Supabase could not send the code |
Example
POST /api/auth/change-password
Change the password for the currently authenticated user. The current password is verified before applying the update.Auth required: Yes — include
Authorization: Bearer <accessToken>.Request body
The user’s current password.
The desired new password. Must be 8–30 characters.
Response — 200 OK
true on success."Password updated successfully."Error responses
| Status | Condition |
|---|---|
400 | oldPassword is incorrect, or newPassword length is out of range |
401 | Missing or invalid Bearer token |