1 |
use serde::{Deserialize, Serialize};
|
2 |
|
3 |
use crate::model::authenticated::UserAuthenticationToken;
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
11 |
pub struct RegisterAccountRequest {
|
12 |
pub username: String,
|
13 |
pub email: Option<String>,
|
14 |
pub password: String,
|
15 |
}
|
16 |
|
17 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
18 |
pub struct RegisterAccountResponse {
|
19 |
pub token: String,
|
20 |
}
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
34 |
pub struct AuthenticationTokenRequest {
|
35 |
pub username: String,
|
36 |
pub password: String,
|
37 |
}
|
38 |
|
39 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
40 |
pub struct AuthenticationTokenResponse {
|
41 |
pub token: UserAuthenticationToken,
|
42 |
}
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
55 |
pub struct TokenExtensionRequest {
|
56 |
pub token: UserAuthenticationToken,
|
57 |
}
|
58 |
|
59 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
60 |
pub struct TokenExtensionResponse {
|
61 |
pub new_token: Option<String>,
|
62 |
}
|
63 |
|