user_credentials: A JSON object with the user's username and password.
Description:
This enhanced version of the login endpoint offers additional features over its predecessor. When a user is authenticated, it returns a JWT access token, as well as a refresh token to enable future token renewals without requiring re-authentication. The endpoint also handles cases where the login request originates from a web UI, setting the JWT as a cookie.
Response:
A JSON object containing the user's user_id, username, the access_token and its token_type which is "bearer", as well as the refresh_token and their respective expiration times.
refresh_token: A JSON object with the refresh token used to generate a new access token.
Description:
This endpoint allows a user to refresh their JWT access token using a valid refresh token. By using the refresh mechanism, users can obtain a new access token without undergoing a full re-authentication process.
Response:
A JSON object containing the user's user_id, username, a new access_token and its token_type which is "bearer", as well as the existing refresh_token and their respective expiration times.