1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use chrono::serde::ts_seconds;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

use crate::Identity;

#[derive(Deserialize, Serialize, Clone)]
pub struct RecoveryCode {
    pub code: String,
    #[serde(with = "ts_seconds")]
    pub generation_time: DateTime<Utc>,
    pub identity: Identity,
}

#[derive(Serialize, Deserialize)]
pub struct RecoveryCodeResponse {
    pub identity: Identity,
    pub token: String,
}