Authenticates a user with their credentials and issues an access token.
The username of the user attempting to log in.
The password of the user.
A promise that resolves to a new access token if authentication succeeds.
Logs a user out of the system
The username of the user logging out.
A promise that resolves once the logout process is complete.
Refreshes an expired or soon-to-expire access token with a new one.
The refresh or access token to exchange.
A promise that resolves to a new access token.
Validates an access token and extracts its payload.
The JWT to validate.
A promise that resolves with the decoded payload if valid,
or null if the token is invalid or expired.
Service interface for handling authentication and authorization.