Skip to content

Commit

Permalink
fix: Secure cookies
Browse files Browse the repository at this point in the history
These should eventually move to options in the auth config
  • Loading branch information
philipcristiano committed Oct 2, 2024
1 parent e7dd7ca commit ca58071
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/oidc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ async fn login_auth(
let max_age_duration = tower_cookies::cookie::time::Duration::new(max_age.num_seconds(), 0);
user_cookie.set_path("/");
user_cookie.set_max_age(Some(max_age_duration));
user_cookie.set_same_site(Some(tower_cookies::cookie::SameSite::Strict));
user_cookie.set_secure(Some(true));
user_cookie.set_http_only(Some(true));
private_cookies.add(user_cookie);

Ok(Redirect::to(&config.post_auth_path).into_response())
Expand Down

0 comments on commit ca58071

Please sign in to comment.