Skip to content

Commit 818b7c7

Browse files
author
Robert Schuh
committed
support bearer prefix in token cookie
1 parent 11c8ab6 commit 818b7c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ func (s *server) validateDeviceToken(r *http.Request) (claims jwt.MapClaims, ok
210210
s.Logger.Debugw("Failed to extract token from cookie", "err", err, "extractErr", extractErr, "x-request-id", r.Header.Get("x-request-id"))
211211
return nil, false
212212
}
213-
jwtB64 = cookie.Value
213+
if strings.EqualFold(cookie.Value[:7], "bearer ") {
214+
jwtB64 = cookie.Value[7:]
215+
} else {
216+
jwtB64 = cookie.Value
217+
}
214218
}
215219
}
216220

0 commit comments

Comments
 (0)