-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CookieClearingLogoutHandler enhancement #6116
Conversation
Enabled the ability to pass in an array of Cookies to support clearing cookies on a different path other than the default context path Issue: spring-projectsgh-6078
FYI - I wasn't sure what to put in for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @maxcoinage! I have provided feedback inline.
* | ||
* @author Luke Taylor | ||
* @since 3.1 | ||
*/ | ||
public final class CookieClearingLogoutHandler implements LogoutHandler { | ||
private final List<String> cookiesToClear; | ||
private final List<Object> cookiesToClear; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change this to List<Function<HttpServletRequest,Cookie>>
. In each of the constructors we can convert the arguments into a Function<HttpServletRequest,Cookie>
.
} | ||
|
||
/** | ||
* @since 5.X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to 5.2
response.addCookie(cookie); | ||
for (Object cookie : cookiesToClear) { | ||
Cookie realCookie = null; | ||
if (cookie instanceof String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic will obviously need updated once we change this.cookiesToClear
.
Changed the implementation to use an anonymous function Issue: spring-projectsgh-6078
@rwinch Thanks for the feedback, I was not too happy with my initial solution and think your proposal is much better PR is now updated, please check at your convenience |
Enabled the ability to pass in an array of Cookies to support clearing cookies on a different path other than the default context path
Issue: gh-6078
Issue #6078
cc: @rwinch