diff --git a/rust/agama-server/src/web/auth.rs b/rust/agama-server/src/web/auth.rs index cdb3eba495..5394cc5fbc 100644 --- a/rust/agama-server/src/web/auth.rs +++ b/rust/agama-server/src/web/auth.rs @@ -78,7 +78,7 @@ impl FromRequestParts for TokenClaims { .await .map_err(|_| AuthError::MissingToken)?; cookie - .get("token") + .get("agamaToken") .ok_or(AuthError::MissingToken)? .to_owned() } diff --git a/rust/agama-server/src/web/http.rs b/rust/agama-server/src/web/http.rs index bbb71966c9..dce25e517e 100644 --- a/rust/agama-server/src/web/http.rs +++ b/rust/agama-server/src/web/http.rs @@ -60,7 +60,7 @@ pub async fn login( }); let mut headers = HeaderMap::new(); - let cookie = format!("token={}; HttpOnly", &token); + let cookie = format!("agamaToken={}; HttpOnly", &token); headers.insert( SET_COOKIE, cookie.parse().expect("could not build a valid cookie"), @@ -74,7 +74,7 @@ pub async fn login( ))] pub async fn logout(_claims: TokenClaims) -> Result { let mut headers = HeaderMap::new(); - let cookie = "token=deleted; HttpOnly; Expires=Thu, 01 Jan 1970 00:00:00 GMT".to_string(); + let cookie = "agamaToken=deleted; HttpOnly; Expires=Thu, 01 Jan 1970 00:00:00 GMT".to_string(); headers.insert( SET_COOKIE, cookie.parse().expect("could not build a valid cookie"),