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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Public module.

use DTO;

/// Struct for signup verification
#[derive(Clone, RustcEncodable, RustcDecodable)]
pub struct RegisterDTO {
    /// The users username
    pub username: String,
    /// The users password
    pub password: String,
    /// The users email
    pub email: String,
    /// Posible referer
    pub referer: Option<String>,
}

impl DTO for RegisterDTO {}

/// The login date type object
#[derive(RustcEncodable, RustcDecodable)]
pub struct LoginDTO {
    /// The users username or email
    pub user_email: String,
    /// The users password
    pub password: String,
    /// Extends the token time,
    pub remember_me: bool,
}

impl DTO for LoginDTO {}

/// Struct to reset the users password
#[derive(Clone, RustcEncodable, RustcDecodable)]
pub struct ResetPasswordDTO {
    /// Where the email of the user
    pub email: String,
}

impl DTO for ResetPasswordDTO {}

/// The new password data type object
#[derive(RustcEncodable, RustcDecodable)]
pub struct NewPasswordDTO {
    /// The new password
    pub new_password: String,
}

impl DTO for NewPasswordDTO {}