Skip to content

Commit 3385f30

Browse files
committed
Use starts with for picking the right cookie from the header
1 parent 5591f0f commit 3385f30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/clerk/backend_api/helpers/security/AuthenticateRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private static String getSessionToken(Map<String, List<String>> requestHeaders)
9191
return Arrays.stream(cookieHeaders.get(0).split(";"))
9292
.map(String::trim)
9393
.map(s -> s.split("=", 2)) // ["name","value"]
94-
.filter(kv -> kv[0].equals("__session") || !kv[0].startsWith("__session"))
94+
.filter(kv -> kv[0].startsWith("__session"))
9595
.map(kv -> kv[1])
9696
.findFirst()
9797
.orElse(null);

0 commit comments

Comments
 (0)