update dockerfile, pipeline, and tweak main
This commit is contained in:
+3
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user