Skip to content

Commit

Permalink
feat: fixing secure cookie default
Browse files Browse the repository at this point in the history
  • Loading branch information
112batuhan committed Dec 2, 2024
1 parent 1f23449 commit 1f954b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/handlers/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ pub async fn osu_oauth2_redirect(
let mut redirect_response = Redirect::to(POST_LOGIN_REDIRECT_URI.as_str()).into_response();
let headers = redirect_response.headers_mut();
let mut user_token_cookie_string = format!(
"user_token={};HttpOnly;Max-Age=86400;Path=/;SameSite=lax;Secure",
"user_token={};HttpOnly;Max-Age=86400;Path=/;SameSite=lax",
token
);
let mut logged_in_cookie_string =
"logged_in=true;Max-Age=86400;Path=/;SameSite=lax;Secure".to_string();
"logged_in=true;Max-Age=86400;Path=/;SameSite=lax".to_string();
if *SECURE_COOKIE {
user_token_cookie_string += "Secure";
logged_in_cookie_string += "Secure";
user_token_cookie_string += ";Secure";
logged_in_cookie_string += ";Secure";
}

headers.append(SET_COOKIE, user_token_cookie_string.parse().unwrap());
Expand Down

0 comments on commit 1f954b4

Please sign in to comment.