login

suspend fun login(username: String, password: String): Session

Logs in a user with the provided username and password. This function constructs a Login.Request and then calls the overloaded login function.

Return

A Session containing the JWT token and user details.

Parameters

username

The username of the user.

password

The password of the user.


suspend fun login(request: Auth.Login.Request): Session

Logs in a user with the provided Login.Request object. On successful login, the received JWT token is stored for subsequent authenticated requests.

Return

A Session containing the JWT token and user details.

Parameters

request

The Login.Request object containing username and password.


suspend fun login(apiKey: String): Session

Logs in a user using an API key. This method is intended for use with Umami Cloud or instances where API key authentication is enabled.

Return

A Session object containing the user's session details.

Parameters

apiKey

The API key to use for authentication.