mirror of
https://github.com/sismics/docs.git
synced 2024-11-16 11:17:57 +01:00
Fix authentication cookie extraction
This commit is contained in:
parent
ee159f5b36
commit
a81474b40a
@ -323,7 +323,7 @@ public class UserResource extends BaseResource {
|
||||
|
||||
// Deletes the client token in the HTTP response
|
||||
JsonObjectBuilder response = Json.createObjectBuilder();
|
||||
NewCookie cookie = new NewCookie(TokenBasedSecurityFilter.COOKIE_NAME, null);
|
||||
NewCookie cookie = new NewCookie(TokenBasedSecurityFilter.COOKIE_NAME, null, "/", null, 1, null, -1, new Date(1), false, false);
|
||||
return Response.ok().entity(response.build()).cookie(cookie).build();
|
||||
}
|
||||
|
||||
@ -646,7 +646,8 @@ public class UserResource extends BaseResource {
|
||||
private String getAuthToken() {
|
||||
if (request.getCookies() != null) {
|
||||
for (Cookie cookie : request.getCookies()) {
|
||||
if (TokenBasedSecurityFilter.COOKIE_NAME.equals(cookie.getName())) {
|
||||
if (TokenBasedSecurityFilter.COOKIE_NAME.equals(cookie.getName())
|
||||
&& !Strings.isNullOrEmpty(cookie.getValue())) {
|
||||
return cookie.getValue();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user