/
GreyCat
/
openhuman
Обзор
Документация
Войти
/
GreyCat
/
openhuman
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/api/models/auth.rs
44 строки
1 KB
Steven Enamakel
Refactor controller registration into domain schemas and generic registry (#53)
30 мар 2026, 01:59
Не верифицирован
30 мар 2026, 01:59
c1a3ae1
Код
Авторство
О чём код?
use serde::{Deserialize, Serialize}; /// User session information #[allow(dead_code)] #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Session { /// JWT session token pub token: String, /// User ID pub user_id: String, /// When the session was created (Unix timestamp) pub created_at: u64, /// When the session expires (Unix timestamp) pub expires_at: Option<u64>, } /// User profile information #[derive(Debug, Clone, Serialize, Deserialize)] pub struct User { pub id: String, #[serde(rename = "firstName")] pub first_name: Option<String>, #[serde(rename = "lastName")] pub last_name: Option<String>, pub username: Option<String>, pub email: Option<String>, #[serde(rename = "telegramId")] pub telegram_id: Option<String>, } /// Auth error response from backend #[allow(dead_code)] #[derive(Debug, Deserialize)] pub struct AuthErrorResponse { pub success: bool, pub error: Option<String>, } /// Auth state that can be emitted to frontend #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AuthState { pub is_authenticated: bool, pub user: Option<User>, }