aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes/users.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-06-20 22:01:26 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-06-20 22:01:26 +0200
commit951cb293111db9ea0947cd65872da744bce92d31 (patch)
treed232f6c1443b96b24d821fdf05b1d96037091c30 /planetwars-server/src/routes/users.rs
parenta2a8a41689ad07eb2236ee438e9d01266946008d (diff)
downloadplanetwars.dev-951cb293111db9ea0947cd65872da744bce92d31.tar.xz
planetwars.dev-951cb293111db9ea0947cd65872da744bce92d31.zip
upgrade to axum 0.5
Diffstat (limited to 'planetwars-server/src/routes/users.rs')
-rw-r--r--planetwars-server/src/routes/users.rs6
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()
}
}
}