The login endpoint accepts two authentication paths: standard credential login (username or email plus password) and Google login (email only, or with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/diarpicu2022-commits/backend-AgroPulse/llms.txt
Use this file to discover all available pages before exploring further.
googleId). On success it returns the sanitized user object — no password hash is ever included. Accounts that sign in via Google are auto-created on first login with the OPERATOR role.
Request body
- Standard login
- Google login
Provide either
username or email together with password.The user’s unique username. Used as the primary lookup key. Either
username or email must be present.The user’s email address. Used as a fallback lookup when
username is not supplied.The user’s password in plain text. Verified against the stored BCrypt hash. Legacy plain-text passwords are automatically upgraded to BCrypt on first successful login.
Response
A200 OK response returns the user object directly.
Auto-incremented integer primary key.
Unique username. For Google-created accounts this is set to the user’s email address.
The user’s display name.
The user’s email address.
Optional phone number.
URL of the user’s profile picture.
The user’s role. One of
ADMIN, AGRONOMIST, OPERATOR, VIEWER, or USER.Whether the account is active. Defaults to
true on creation.ISO 8601 datetime when the account was created.
List of greenhouse IDs the user has access to. Empty array if none are assigned.
Error responses
| Status | error value | Cause |
|---|---|---|
401 | Usuario no encontrado | No user matched the provided username or email. |
401 | Contraseña incorrecta | The password did not match the stored hash. |
Examples
- Standard login
- Google login