axum rewrite #35

Merged
radical merged 21 commits from staging into main 2025-07-20 17:25:04 +00:00
4 changed files with 4 additions and 5 deletions
Showing only changes of commit d2fec66ddb - Show all commits

View file

@ -105,7 +105,7 @@ pub async fn response(
response.headers_mut().append(
"Set-Cookie",
HeaderValue::from_str(
&new_access_token_cookie(&app_state.config, access_token).to_string(),
&new_access_token_cookie(access_token).to_string(),
)?,
);

View file

@ -123,7 +123,7 @@ pub async fn post(
response.headers_mut().append(
"Set-Cookie",
HeaderValue::from_str(
&new_access_token_cookie(&app_state.config, access_token).to_string(),
&new_access_token_cookie(access_token).to_string(),
)?,
);

View file

@ -171,7 +171,7 @@ pub async fn post(
response.headers_mut().append(
"Set-Cookie",
HeaderValue::from_str(
&new_access_token_cookie(&app_state.config, access_token).to_string(),
&new_access_token_cookie(access_token).to_string(),
)?,
);

View file

@ -43,12 +43,11 @@ pub fn new_refresh_token_cookie(config: &Config, refresh_token: String) -> Cooki
.build()
}
pub fn new_access_token_cookie(config: &Config, access_token: String) -> Cookie {
pub fn new_access_token_cookie<'cookie>(access_token: String) -> Cookie<'cookie> {
Cookie::build(("access_token", access_token))
.http_only(false)
.secure(true)
.same_site(SameSite::None)
.path(config.web.backend_url.path().to_string())
.max_age(Duration::hours(1))
.build()
}