aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/account/session/mod.rs
blob: b13f157d2fc2316cf4cb3a4eeeaa409ffd1d90b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2023 metamuffin <metamuffin.org>
*/
use crate::database::User;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

pub mod guard;
pub mod token;

pub struct Session {
    pub user: User,
}

pub struct AdminSession(pub Session);

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SessionData {
    username: String,
    expire: DateTime<Utc>,
}