Skip to content

Commit fb80f9a

Browse files
committed
refactor: Enhance cookie removal logic in OIDC logout process
This commit updates the cookie removal process during OIDC logout by utilizing the `Cookie::build` method to specify cookie attributes, improving clarity and ensuring proper cookie handling.
1 parent 8ac9200 commit fb80f9a

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/webserver/oidc.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,16 @@ async fn process_oidc_logout(
489489
build_redirect_response(params.redirect_uri)
490490
};
491491

492-
response.add_removal_cookie(&Cookie::named(SQLPAGE_AUTH_COOKIE_NAME))?;
493-
response.add_removal_cookie(&Cookie::named(SQLPAGE_NONCE_COOKIE_NAME))?;
492+
response.add_removal_cookie(
493+
&Cookie::build(SQLPAGE_AUTH_COOKIE_NAME, "")
494+
.path("/")
495+
.finish(),
496+
)?;
497+
response.add_removal_cookie(
498+
&Cookie::build(SQLPAGE_NONCE_COOKIE_NAME, "")
499+
.path("/")
500+
.finish(),
501+
)?;
494502

495503
log::debug!("User logged out successfully");
496504
Ok(response)

0 commit comments

Comments
 (0)