update dockerfile, pipeline, and tweak main

This commit is contained in:
Mitchell Marino
2023-04-05 14:55:44 -05:00
parent 2856b1bbd8
commit c786b36cd3
3 changed files with 9 additions and 2 deletions
+3 -1
View File
@@ -14,6 +14,7 @@ use std::net::SocketAddr;
#[derive(Clone, Serialize, Deserialize, Debug, Hash)]
struct Claims {
id: i32,
username: String,
}
@@ -121,7 +122,7 @@ async fn signin(
let result = sqlx::query!(
r#"
SELECT username
SELECT id, username
FROM users
WHERE username = $1 AND password = $2
"#,
@@ -134,6 +135,7 @@ async fn signin(
match result {
Ok(Some(user)) => {
let claims = Claims {
id: user.id,
username: user.username,
};
let token = match jsonwebtoken::encode(&Header::default(), &claims, &app_state.jwt_key)