You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(body.isEmpty()) { body = "{\"message\": \"\",}"; }
116
124
HttpClientclient = HttpClient.newHttpClient();
117
125
HttpRequestrequest = HttpRequest.newBuilder()
118
126
.uri(URI.create(url))
@@ -143,6 +151,7 @@ public String generateLineGraph() {
143
151
144
152
/**
145
153
* Gets an access token using the refresh token in storage and replaces the old refresh token with the new one
154
+
*
146
155
* @return Returns the new access token
147
156
*/
148
157
publicStringsetTokenViaRefresh() {
@@ -202,7 +211,7 @@ public void setTokenViaAuth() {
202
211
}
203
212
204
213
publicbooleancheckFor401(Stringinput) {
205
-
if(input.contains("401 - Unauthorized")) {
214
+
if(input.contains("401 - Unauthorized")) {
206
215
try {
207
216
setTokenViaRefresh();
208
217
thrownewAccessTokenInvalidException("The access token used in this OAuth request was not accepted by the server \nI've already taken the liberty of getting a new access token for you :D");
@@ -214,4 +223,19 @@ public boolean checkFor401(String input) {
0 commit comments