fix: setting up totp when you already have backup codes

This commit is contained in:
MiniDigger | Martin 2023-12-09 21:37:56 +01:00
parent 25eec809c8
commit e2305aab30

View File

@ -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));