Added user login, logout and creation functionality

Also minor changes to ticketing and AppState
This commit is contained in:
2026-04-24 19:46:02 +02:00
parent fe04483e76
commit 51b6f89df2
10 changed files with 226 additions and 16 deletions

View File

@@ -49,7 +49,7 @@ pub struct TicketUpdateScheme {
pub status: String,
}
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize, Serialize, Debug, sqlx::FromRow)]
pub struct UserCreateScheme {
pub first_name: String,
pub last_name: String,
@@ -64,6 +64,23 @@ pub struct LoginScheme {
pub pwd: String,
}
#[derive(Deserialize, Serialize, Debug, sqlx::FromRow)]
pub struct LoginModel {
pub id: i16,
pub first_name: String,
pub last_name: String,
pub is_admin: bool,
pub pwd: String,
}
#[derive(Debug, Serialize)]
pub struct FilteredUser {
pub id: i16,
pub first_name: String,
pub last_name: String,
pub is_admin: bool,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Claims {
pub subject: String,