diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-18 21:03:34 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-18 21:03:34 +0200 |
commit | 7daf8f643798ce76733006f8469890bf1a3fd05e (patch) | |
tree | d755c4f0979f56792684b109d263624aef4baaad /planetwars-server/src/routes/users.rs | |
parent | 608d05bc167c57d190d3c06f250b5e4a5662e77e (diff) | |
parent | d092f5d89c0fda5cc67349d5489b4ef1b294e053 (diff) | |
download | planetwars.dev-7daf8f643798ce76733006f8469890bf1a3fd05e.tar.xz planetwars.dev-7daf8f643798ce76733006f8469890bf1a3fd05e.zip |
Merge branch 'next'
Diffstat (limited to 'planetwars-server/src/routes/users.rs')
-rw-r--r-- | planetwars-server/src/routes/users.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/planetwars-server/src/routes/users.rs b/planetwars-server/src/routes/users.rs index 54ddd09..1989904 100644 --- a/planetwars-server/src/routes/users.rs +++ b/planetwars-server/src/routes/users.rs @@ -5,7 +5,7 @@ use axum::extract::{FromRequest, RequestParts, TypedHeader}; use axum::headers::authorization::Bearer; use axum::headers::Authorization; use axum::http::StatusCode; -use axum::response::{Headers, IntoResponse, Response}; +use axum::response::{IntoResponse, Response}; use axum::{async_trait, Json}; use serde::{Deserialize, Serialize}; use serde_json::json; @@ -163,9 +163,9 @@ pub async fn login(conn: DatabaseConnection, params: Json<LoginParams>) -> Respo Some(user) => { let session = sessions::create_session(&user, &conn); let user_data: UserData = user.into(); - let headers = Headers(vec![("Token", &session.token)]); + let headers = [("Token", &session.token)]; - (headers, Json(user_data)).into_response() + (StatusCode::OK, headers, Json(user_data)).into_response() } } } |