|
@@ -57,14 +57,11 @@ public class JwtUtil {
|
|
*/
|
|
*/
|
|
public static String getUsername(String token) {
|
|
public static String getUsername(String token) {
|
|
try {
|
|
try {
|
|
- if (token != "" && token != null) {
|
|
|
|
- DecodedJWT jwt = JWT.decode(token);
|
|
|
|
- return jwt.getClaim("username").asString();
|
|
|
|
- }
|
|
|
|
|
|
+ DecodedJWT jwt = JWT.decode(token);
|
|
|
|
+ return jwt.getClaim("username").asString();
|
|
} catch (JWTDecodeException e) {
|
|
} catch (JWTDecodeException e) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|