Skip to main content

login

Function login 

Source
pub async fn login(
    __arg0: State<State>,
    __arg1: Json<LoginRequest>,
) -> Result<Json<LoginResponse>>
Expand description

Authenticates a user and generates a new session token.

This endpoint verifies the provided identity hash and auth verifier against the database. If successful, it creates a new session and returns the token.

ยงErrors

  • Returns a BadRequest if the identity hash cannot be decoded from hex.
  • Returns an Unauthorized if the credentials do not match any existing user.
  • Returns an internal error if a database query fails.