bitwarden_core/auth/api/response/
identity_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
24
25
26
27
28
29
30
31
use std::collections::HashMap;

use serde::{Deserialize, Serialize};
use serde_json::Value;

#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct IdentityCaptchaResponse {
    pub error: String,
    pub error_description: String,
    #[serde(rename = "HCaptcha_SiteKey")]
    pub site_key: String,

    /// Stores unknown api response fields
    extra: Option<HashMap<String, Value>>,
}

#[cfg(test)]
mod test {
    use super::*;

    impl Default for IdentityCaptchaResponse {
        fn default() -> Self {
            Self {
                error: "invalid_grant".into(),
                error_description: "Captcha required.".into(),
                site_key: Default::default(),
                extra: Default::default(),
            }
        }
    }
}