TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gavafue/registroComponentesMultimedia/llms.txt
Use this file to discover all available pages before exploring further.
auth.php file exposes three endpoints that manage administrator identity using PHP native sessions. After a successful login the server sets a session cookie; all subsequent requests from the same browser automatically present that cookie, granting access to protected loan routes. Sessions are stored on disk under api/sesiones/ and are started via session_start() on every API request through config.php.
POST auth.php?action=login
Authenticates an admin user against the users table using password_verify. On success a PHP session is created and the session cookie is written to the response.
Request Body
The admin account username.
The plain-text password. Verified against the stored bcrypt hash.
Responses
Present on success. Value:
"Login exitoso".Present on failure. See status codes below.
| Status | Body | Condition |
|---|---|---|
| 200 | { "message": "Login exitoso" } | Credentials valid, session created |
| 400 | { "error": "Faltan credenciales" } | username or password missing |
| 401 | { "error": "Credenciales inválidas" } | Username not found or password wrong |
curl Example
-c cookies.txt and replay it with -b cookies.txt on subsequent requests.
JavaScript Client
GET auth.php?action=check
Returns the current session state. Designed to be called at application startup so the UI can decide whether to show the admin panel or the public view.
Request
No request body. No query parameters beyondaction=check.
Responses
true when an active admin session exists, false otherwise.The authenticated admin’s username. Only present when
logged_in is true.| Status | Body | Condition |
|---|---|---|
| 200 | { "logged_in": true, "username": "admin" } | Active session found |
| 200 | { "logged_in": false } | No active session |
This endpoint always returns HTTP 200. It never throws a 401, so the frontend can call it safely at startup without a try/catch. Check the
logged_in boolean in the response body instead.curl Example
JavaScript Client
POST auth.php?action=logout
Destroys the current PHP session using session_destroy(). After this call the session cookie becomes invalid and protected routes will return 401.
Request
No request body is required.Responses
Present on success. Value:
"Logout exitoso".Present when the action or HTTP method is not recognised. Value:
"Acción no válida".| Status | Body | Condition |
|---|---|---|
| 200 | { "message": "Logout exitoso" } | Session destroyed successfully |
| 400 | { "error": "Acción no válida" } | Wrong HTTP method or unrecognised action |