fix: revert changes to access_token made during refactor
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful

This commit is contained in:
Radical 2025-07-19 23:39:56 +02:00
parent d2fec66ddb
commit 9bf435b535
6 changed files with 25 additions and 59 deletions

View file

@ -14,12 +14,13 @@ use diesel::{ExpressionMethods, QueryDsl, dsl::insert_into};
use diesel_async::RunQueryDsl;
use serde::Deserialize;
use super::Response;
use crate::{
AppState,
error::Error,
schema::*,
utils::{
PASSWORD_REGEX, generate_token, new_access_token_cookie, new_refresh_token_cookie,
PASSWORD_REGEX, generate_token, new_refresh_token_cookie,
user_uuid_from_identifier,
},
};
@ -93,7 +94,7 @@ pub async fn response(
.execute(&mut conn)
.await?;
let mut response = StatusCode::OK.into_response();
let mut response = (StatusCode::OK, Json(Response { access_token })).into_response();
response.headers_mut().append(
"Set-Cookie",
@ -102,12 +103,5 @@ pub async fn response(
)?,
);
response.headers_mut().append(
"Set-Cookie",
HeaderValue::from_str(
&new_access_token_cookie(access_token).to_string(),
)?,
);
Ok(response)
}