forked from Txio-labs/txio-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresponse.rs
More file actions
35 lines (32 loc) · 1.09 KB
/
Copy pathresponse.rs
File metadata and controls
35 lines (32 loc) · 1.09 KB
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
use crate::model::user::{GitHubAccount, NotificationPreferences};
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct UserResponse {
pub id: String,
pub name: String,
pub email: String,
pub created_at: String,
pub notification_preferences: NotificationPreferences,
pub github_account: Option<GitHubAccount>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AuthResponse {
pub token: String,
pub user: UserResponse,
}
/// A single active session entry returned to the client.
#[derive(Debug, Serialize, Deserialize)]
pub struct SessionResponse {
/// MongoDB ObjectId string — used as the revocation target.
pub id: String,
/// Human-readable device label, e.g. "Chrome on macOS".
pub device_label: String,
/// IP address recorded at sign-in time.
pub ip_address: String,
/// ISO-8601 creation timestamp.
pub created_at: String,
/// ISO-8601 last-active timestamp.
pub last_active_at: String,
/// True when this session matches the JWT that issued the current request.
pub is_current: bool,
}