bitwarden_core/auth/login/response/
captcha_response.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, JsonSchema)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct CaptchaResponse {
    /// hcaptcha site key
    pub site_key: String,
}

impl From<crate::auth::api::response::IdentityCaptchaResponse> for CaptchaResponse {
    fn from(api: crate::auth::api::response::IdentityCaptchaResponse) -> Self {
        Self {
            site_key: api.site_key,
        }
    }
}

impl From<String> for CaptchaResponse {
    fn from(s: String) -> Self {
        Self { site_key: s }
    }
}