Skip to main content

bitwarden_auth/login/models/
login_request.rs

1use serde::{Deserialize, Serialize};
2
3use super::LoginDeviceRequest;
4
5/// The common bucket of login fields to be re-used across all login mechanisms
6/// (e.g., password, SSO, etc.). This will include handling client_id and 2FA.
7#[derive(Serialize, Deserialize, Debug)]
8#[serde(rename_all = "camelCase", deny_unknown_fields)]
9#[cfg_attr(feature = "uniffi", derive(uniffi::Record))] // add mobile support
10#[bitwarden_ffi::wasm_record] // add wasm support
11pub struct LoginRequest {
12    /// OAuth client identifier
13    pub client_id: String,
14
15    /// Device information for this login request
16    pub device: LoginDeviceRequest,
17    // TODO: add two factor support
18    // Two-factor authentication
19    // pub two_factor: Option<TwoFactorRequest>,
20}