Internally renamed variable `token` to `tokens` since the JSON helds more tah one token
This commit is contained in:
parent
79c45245dd
commit
3c201dd6f0
|
@ -26,7 +26,7 @@ public class JWTToken implements Serializable {
|
|||
public static final String ACCOUNT_RESOURCE = "account";
|
||||
|
||||
private String raw;
|
||||
private JSONObject token;
|
||||
private JSONObject tokens;
|
||||
private JSONObject payload;
|
||||
|
||||
public static JWTToken fromString(String tokenString) {
|
||||
|
@ -47,7 +47,7 @@ public class JWTToken implements Serializable {
|
|||
}
|
||||
|
||||
private void parse() throws ParseException {
|
||||
token = (JSONObject) new JSONParser().parse(this.raw);
|
||||
tokens = (JSONObject) new JSONParser().parse(this.raw);
|
||||
String[] parts = getAccessTokenString().split("\\.");
|
||||
payload = (JSONObject) new JSONParser().parse(new String(Base64.getDecoder().decode(parts[1])));
|
||||
}
|
||||
|
@ -57,11 +57,11 @@ public class JWTToken implements Serializable {
|
|||
}
|
||||
|
||||
public String getAccessTokenString() {
|
||||
return (String) token.get("access_token");
|
||||
return (String) tokens.get("access_token");
|
||||
}
|
||||
|
||||
public String getRefreshTokenString() {
|
||||
return (String) token.get("refresh_token");
|
||||
return (String) tokens.get("refresh_token");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue