Authentication
Request the CSRF Token as well as the session token from the CSRF Request.
Save the CSRF Token and session token somewhere at your end.
Execute the login request with the CSRF Token and session token as cookies.
Get CSRF Token
This endpoint returns a CSRF token as a cookie (XSRF-TOKEN) and a session cookie (fms_session).
The CSRF token must be included in the X-XSRF-TOKEN header of subsequent state-changing requests.
Request parameters
Responses
User Login
Authenticates a user with username (which can be an email or username) and password.
Returns a session cookie (fms_session) if successful.
Requires prior call to /sanctum/csrf-cookie to obtain CSRF token.
Request parameters
{
"username": "example",
"password": "example"
}
Responses
{
"message": "The given data was invalid.",
"errors": {
"username": [
"The username field is required."
],
"password": [
"The password must be at least 8 characters."
]
}
}
10 April 2025