-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: delete REDIRECT_URI cookie on successful login
- Loading branch information
Showing
7 changed files
with
124 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/com/gw2auth/oauth2/server/util/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
package com.gw2auth.oauth2.server.util; | ||
|
||
import org.springframework.security.web.savedrequest.CookieRequestCache; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
public final class Constants { | ||
|
||
public static final String LOGOUT_URL = "/auth/logout"; | ||
public static final String ACCESS_TOKEN_COOKIE_NAME = "BEARER"; | ||
public static final String REDIRECT_URI_COOKIE_NAME; | ||
|
||
static { | ||
try { | ||
final Field field = CookieRequestCache.class.getDeclaredField("COOKIE_NAME"); | ||
final boolean wasAccessible = field.canAccess(null); | ||
field.setAccessible(true); | ||
REDIRECT_URI_COOKIE_NAME = (String) field.get(null); | ||
field.setAccessible(wasAccessible); | ||
} catch (ReflectiveOperationException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters