File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
src/java/main/com/cronos/onlinereview/util Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,14 @@ public JwtTokenUpdater check() throws Exception {
100
100
String [] tokenSplit = jwtCookieV3 .getValue ().split ("\\ ." );
101
101
if (tokenSplit .length <= 1 ) {
102
102
valid = false ;
103
- } /* else {
104
- StringBuffer payloadStr = new StringBuffer(tokenSplit[1]);
105
- while (payloadStr.length() % 4 != 0) {
103
+ } else {
104
+ // StringBuffer payloadStr = new StringBuffer(tokenSplit[1]);
105
+ /* while (payloadStr.length() % 4 != 0) {
106
106
payloadStr.append('=');
107
- }
108
-
109
- String payload = new String(Base64.decode(payloadStr.toString().getBytes(StandardCharsets.UTF_8)));
107
+ }*/
108
+ //String payload = new String(Base64.decode(payloadStr.toString().getBytes(StandardCharsets.UTF_8)));
109
+
110
+ String payload = new String (Base64 .decodeBase64 (tokenSplit [1 ]), "UTF-8" );
110
111
JsonNode jsonNode = objectMapper .readValue (payload .toString (), JsonNode .class );
111
112
112
113
long exp = jsonNode .get ("exp" ).asLong ();
@@ -115,7 +116,7 @@ public JwtTokenUpdater check() throws Exception {
115
116
if (expDate .before (new Date ())) {
116
117
valid = false ;
117
118
}
118
- }*/
119
+ }
119
120
}
120
121
if (jwtCookieV3 == null || !valid ) {
121
122
String newToken = getRefreshTokenFromApi (jwtCookieV2 .getValue ());
You can’t perform that action at this time.
0 commit comments