Skip to main content

try_extract_otp

Function try_extract_otp 

Source
pub async fn try_extract_otp(
    parts: &Parts,
    app: &Arc<AppState>,
) -> Option<Result<AuthResult, Response>>
Expand description

Attempt to extract and validate HTTP Basic (OTP) credentials.

Returns:

  • Some(Ok(AuthResult)) — valid OTP, authentication succeeded
  • Some(Err(Response)) — credentials present but invalid (401)
  • None — no HTTP Basic header present (try next auth method)