Skip to content

Commit

Permalink
Feat(authentication.rs): Add Secure and No SameSite to Authentication…
Browse files Browse the repository at this point in the history
… Cookies
  • Loading branch information
WillKirkmanM committed Oct 14, 2024
1 parent fa8f6a5 commit 0d131ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/backend/src/routes/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ pub async fn login(form: web::Json<AuthData>) -> impl Responder {
if let Err(_) = response.add_cookie(
&Cookie::build("plm_refreshToken", generated_refresh_token)
.http_only(true)
.same_site(SameSite::Lax)
.same_site(SameSite::None)
.secure(true)
.path("/")
.finish(),
) {
Expand All @@ -127,10 +128,11 @@ pub async fn login(form: web::Json<AuthData>) -> impl Responder {
message: Some(String::from("Failed to set refresh token cookie")),
});
}

if let Err(_) = response.add_cookie(
&Cookie::build("plm_accessToken", generated_access_token)
.same_site(SameSite::Lax)
.same_site(SameSite::None)
.secure(true)
.path("/")
.finish(),
) {
Expand Down

0 comments on commit 0d131ba

Please sign in to comment.