UniEvents uses a single authentication system for all user types. Attendees (students and the general public) register and log in at the mainDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Edfermachado/proyectoSistemas/llms.txt
Use this file to discover all available pages before exploring further.
/register and /login pages, while faculty administrators use the same login page with a role-type toggle. This guide walks you through creating a new attendee account, signing in, and understanding how sessions are managed.
Creating an Account
Navigate to/register to create a new attendee account. All three fields are required:
| Field | Type | Description |
|---|---|---|
email | email | Your university or personal email address |
password | password | Choose a secure password |
confirmPassword | password | Must match password exactly |
registerUser server action performs the following steps:
- Validates that all fields are present and passwords match.
- Checks that the email is not already registered.
- Hashes the password with bcrypt (10 salt rounds).
- Inserts the new user with
role = 'user'andtenantId = null. - Immediately creates a session cookie — you are logged in right after registration and redirected to
/.
Enter your email
Type a valid email address. This will be your login identifier and the address used for ticket confirmations.
Choose a password
Enter a password and confirm it in the second field. Both values must match or the form will return an error.
Accept the terms
Check the Terms and Conditions checkbox. The submit button is disabled until this is checked.
Logging In
Navigate to/login to sign in. The login page features two tabs that control which authentication path is used:
Comunidad (default)
For registered attendees with
role = 'user'. Calls loginUser and redirects to / on success.Facultad
For faculty administrators with roles
tenant_admin, event_manager, or access_control. Calls loginFacultyAdmin and redirects to /faculty-admin on success.roleType field (comunidad or facultad) that routes to the correct server action via unifiedLoginAction:
role = 'user' account (or vice-versa), authentication will fail with an error message — each action strictly validates the expected role before comparing passwords.
Session Management
Once authenticated, a JWT session is stored in an HTTP-only cookie namedsession. The cookie is inaccessible to client-side JavaScript. In production the cookie carries the Secure flag so it is transmitted only over HTTPS; in development the flag is omitted. The cookie also uses sameSite: "lax" to protect against cross-site request forgery.
The session payload contains the following claims:
Logging Out
Logging out deletes thesession cookie and redirects you to /login. The logoutUser server action handles this:
<form> that invokes logoutUser as a server action, ensuring the redirect happens server-side.
Super-admin accounts (
role = 'superadmin') do not use the main /login page. They authenticate at /admin/login, which calls the separate loginSuperAdmin action and redirects to /admin on success. Entering super-admin credentials on the regular login page will fail because the loginUser action only accepts role = 'user' accounts.