Added user login, logout and creation functionality
Also minor changes to ticketing and AppState
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user