headless_lms_server::domain::authorization

Function exchange_password_with_tmc

Source
pub async fn exchange_password_with_tmc(
    client: &OAuthClient,
    email: String,
    password: String,
) -> Result<Option<LoginToken>>
Expand description

Exchanges user credentials with TMC server to obtain an OAuth token.

This function attempts to authenticate a user with the TMC server using their email and password. It returns different results based on the authentication outcome:

  • Ok(Some(token)) - Authentication successful, returns the OAuth token
  • Ok(None) - Authentication failed due to invalid credentials (email/password)
  • Err(...) - Authentication failed due to other errors (server issues, network problems, etc.)