Skip to main content

revolt_models/v0/
accounts.rs

1auto_derived!(
2    /// # Change Email Data
3    pub struct DataChangeEmail {
4        /// Valid email address
5        pub email: String,
6        /// Current password
7        pub current_password: String,
8    }
9
10    /// # Change Data
11    pub struct DataChangePassword {
12        /// New password
13        pub password: String,
14        /// Current password
15        pub current_password: String,
16    }
17
18    /// # Account Deletion Token
19    pub struct DataAccountDeletion {
20        /// Deletion token
21        pub token: String,
22    }
23
24    /// # Account Data
25    pub struct DataCreateAccount {
26        /// Valid email address
27        pub email: String,
28        /// Password
29        pub password: String,
30        /// Invite code
31        pub invite: Option<String>,
32        /// Captcha verification code
33        pub captcha: Option<String>,
34    }
35
36    pub struct AccountInfo {
37        #[serde(rename = "_id")]
38        pub id: String,
39        pub email: String,
40    }
41
42    /// # Password Reset
43    pub struct DataPasswordReset {
44        /// Reset token
45        pub token: String,
46
47        /// New password
48        pub password: String,
49
50        /// Whether to logout all sessions
51        #[serde(default)]
52        pub remove_sessions: bool,
53    }
54
55    /// # Resend Information
56    pub struct DataResendVerification {
57        /// Email associated with the account
58        pub email: String,
59        /// Captcha verification code
60        pub captcha: Option<String>,
61    }
62
63    /// # Reset Information
64    pub struct DataSendPasswordReset {
65        /// Email associated with the account
66        pub email: String,
67        /// Captcha verification code
68        pub captcha: Option<String>,
69    }
70);