When not logged in redirection to login page

Every page is locked behind a jwt, when it is not supplied neither other
pages not api calls will work
This commit is contained in:
2026-05-01 16:18:15 +02:00
parent b672fe9768
commit e54be14526
8 changed files with 221 additions and 68 deletions

View File

@@ -25,6 +25,8 @@ pub struct TicketResponse {
pub status: String,
pub date: chrono::NaiveDateTime,
pub user_id: i16,
pub user_first_name: String,
pub user_last_name: String,
}
#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, sqlx::FromRow)]
@@ -75,7 +77,7 @@ pub struct LoginScheme {
pub pwd: String,
}
#[derive(Debug, Serialize)]
#[derive(Debug, Clone, Serialize)]
pub struct FilteredUser {
pub id: i16,
pub first_name: String,
@@ -86,7 +88,10 @@ pub struct FilteredUser {
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Claims {
pub subject: String,
#[serde(alias = "subject")]
pub sub: String,
#[serde(rename = "iat", alias = "issued", default)]
pub issued: usize,
#[serde(rename = "exp", alias = "expires", default)]
pub expires: usize,
}