Skip to content

Commit

Permalink
fix sonar error
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiladinovic99 committed Jun 6, 2022
1 parent 21fb5eb commit 781353c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public String getUserByToken(String token) {
return decodedToken.getSubject().split(",")[0];
} catch (JWTVerificationException e) {
// TODO find a better exception for this case
throw new UsernameNotFoundException("Token is invalid");
throw new UsernameNotFoundException("bad credentials");
}
}

Expand All @@ -29,7 +29,7 @@ public String getRoleByToken(String token) {
return decodedToken.getSubject().split(",")[1];
} catch (JWTVerificationException e) {
// TODO find a better exception for this case
throw new UsernameNotFoundException("Token is invalid");
throw new UsernameNotFoundException("bad credentials");
}
}

Expand All @@ -40,7 +40,7 @@ public String[] getPermissionsByToken(String token) {
return decodedToken.getClaim("permissions").asArray(String.class);
} catch (JWTVerificationException e) {
// TODO find a better exception for this case
throw new UsernameNotFoundException("Token is invalid");
throw new UsernameNotFoundException("bad credentials");
}
}

Expand Down

0 comments on commit 781353c

Please sign in to comment.