Finish authentication (#659)

This commit is contained in:
Geometrically
2023-07-18 15:02:54 -07:00
committed by GitHub
parent ec80c2b9db
commit 4bb47d7e01
10 changed files with 217 additions and 75 deletions

View File

@@ -26,15 +26,19 @@ pub struct Session {
pub city: Option<String>,
pub country: Option<String>,
pub ip: String,
pub current: bool,
}
impl Session {
pub fn from(
data: crate::database::models::session_item::Session,
include_session: bool,
current_session: Option<&str>,
) -> Self {
Session {
id: data.id.into(),
current: Some(&*data.session) == current_session,
session: if include_session {
Some(data.session)
} else {