You've already forked AstralRinth
forked from didirus/AstralRinth
* Port redis to staging * redis cache on staging * add back legacy auth callback * Begin work on new auth flows * Finish all auth flows * Finish base session authentication * run prep + fix clippy * make compilation work
30 lines
729 B
Rust
30 lines
729 B
Rust
use super::ids::Base62Id;
|
|
use crate::models::users::UserId;
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
#[serde(from = "Base62Id")]
|
|
#[serde(into = "Base62Id")]
|
|
pub struct SessionId(pub u64);
|
|
|
|
#[derive(Serialize, Deserialize, Clone)]
|
|
pub struct Session {
|
|
pub id: SessionId,
|
|
pub session: String,
|
|
pub user_id: UserId,
|
|
|
|
pub created: DateTime<Utc>,
|
|
pub last_login: DateTime<Utc>,
|
|
pub expires: DateTime<Utc>,
|
|
pub refresh_expires: DateTime<Utc>,
|
|
|
|
pub os: Option<String>,
|
|
pub platform: Option<String>,
|
|
pub user_agent: String,
|
|
|
|
pub city: Option<String>,
|
|
pub country: Option<String>,
|
|
pub ip: String,
|
|
}
|