From a0c666aebc32a62bbf421e96b20eca1128de7a81 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 14 Apr 2023 12:17:43 +0200 Subject: [PATCH] Accept "Bearer" authorization prefix Closes #1139 --- .../security/authentication/HangarAuthenticationFilter.java | 2 +- frontend/src/pages/version.vue | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/main/java/io/papermc/hangar/security/authentication/HangarAuthenticationFilter.java b/backend/src/main/java/io/papermc/hangar/security/authentication/HangarAuthenticationFilter.java index b8658b9e..5b498f0c 100644 --- a/backend/src/main/java/io/papermc/hangar/security/authentication/HangarAuthenticationFilter.java +++ b/backend/src/main/java/io/papermc/hangar/security/authentication/HangarAuthenticationFilter.java @@ -59,7 +59,7 @@ public class HangarAuthenticationFilter extends AbstractAuthenticationProcessing private @Nullable String token(final HttpServletRequest request) { final String authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION); if (authorizationHeader != null) { - return authorizationHeader.replace(SecurityConfig.AUTH_NAME, "").trim(); + return authorizationHeader.replace(SecurityConfig.AUTH_NAME, "").replace("Bearer", "").trim(); } final String parameter = request.getParameter("t"); diff --git a/frontend/src/pages/version.vue b/frontend/src/pages/version.vue index 1c85e913..d4ab9665 100644 --- a/frontend/src/pages/version.vue +++ b/frontend/src/pages/version.vue @@ -41,8 +41,6 @@ useHead(useSeo("Hangar Version", null, route, null));

- You can see an overview graph of these milestones here. -
Please report bugs and other problems you encounter to our issue tracker.