From e2305aab30881a595c55d70abb75f43c81431d38 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 9 Dec 2023 21:37:56 +0100 Subject: [PATCH] fix: setting up totp when you already have backup codes --- .../papermc/hangar/components/auth/service/TokenService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/main/java/io/papermc/hangar/components/auth/service/TokenService.java b/backend/src/main/java/io/papermc/hangar/components/auth/service/TokenService.java index 7d6cb744..4fa316fe 100644 --- a/backend/src/main/java/io/papermc/hangar/components/auth/service/TokenService.java +++ b/backend/src/main/java/io/papermc/hangar/components/auth/service/TokenService.java @@ -144,6 +144,9 @@ public class TokenService extends HangarComponent { } public boolean verifyOtp(final long user, final String header) { + if (header == null) { + return true; + } try { final DecodedJWT decoded = this.verify(header.split(":")[1]); return decoded.getSubject().equals(String.valueOf(user));