Authenticates a user with email and password, returning a JWT token for subsequent API requests. The endpoint supports two response formats: a token string or a decoded token object with user details.
{ "status": "error", "code": "404", "message": "El usuario no se ha podido identificar", "errors": { "email": [ "The email field is required." ], "password": [ "The password field is required." ] }, "hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}
Password Hashing: The password is hashed using SHA-256 before authentication. This matches the hashing algorithm used during registration.
Response Format: All login responses return HTTP status code 200, even for errors. Check the status field in the response body to determine success or failure.
JSON Parameter Format: Like the register endpoint, this requires a json parameter containing a JSON string, not direct JSON in the request body.
Token vs Object: Use gettoken: false (default) when you only need the token for API authentication. Use gettoken: true when you need immediate access to user details without making an additional API call.