|
|
@ -29,7 +29,6 @@ public class JWTManager { |
|
|
|
header.put("alg", "HS256"); |
|
|
|
header.put("alg", "HS256"); |
|
|
|
header.put("typ", "JWT"); |
|
|
|
header.put("typ", "JWT"); |
|
|
|
|
|
|
|
|
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
|
|
|
|
Map<String, Object> payload = new HashMap<>(); |
|
|
|
Map<String, Object> payload = new HashMap<>(); |
|
|
|
payload.put("user", user); |
|
|
|
payload.put("user", user); |
|
|
|
payload.put("api_ver", "1"); |
|
|
|
payload.put("api_ver", "1"); |
|
|
@ -52,8 +51,6 @@ public class JWTManager { |
|
|
|
.setSigningKey(key) |
|
|
|
.setSigningKey(key) |
|
|
|
.build() |
|
|
|
.build() |
|
|
|
.parseClaimsJws(token); |
|
|
|
.parseClaimsJws(token); |
|
|
|
|
|
|
|
|
|
|
|
System.out.println(jws); |
|
|
|
|
|
|
|
} catch (JwtException e) { |
|
|
|
} catch (JwtException e) { |
|
|
|
System.err.println("Error: token is wrong: " + e.getMessage()); |
|
|
|
System.err.println("Error: token is wrong: " + e.getMessage()); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|