Skip to content

Commit

Permalink
Fix auth error logs
Browse files Browse the repository at this point in the history
rtm516 committed Jun 19, 2024
1 parent 84d2052 commit 1f95c79
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ private void importLiveTokens() {
empty.addProperty("userHash", "");

JsonObject msaToken = new JsonObject();
msaToken.addProperty("expireTimeMs", 0);//liveToken.get("obtainedOn").getAsLong() + tokenData.get("expires_in").getAsLong() * 1000);
msaToken.addProperty("expireTimeMs", 0);
msaToken.addProperty("accessToken", tokenData.get("access_token").getAsString());
msaToken.addProperty("refreshToken", tokenData.get("refresh_token").getAsString());

@@ -105,7 +105,7 @@ private void importLiveTokens() {
Files.delete(oldLiveAuth);
if (Files.exists(oldXboxAuth)) Files.delete(oldXboxAuth);
} catch (Exception e) {
throw new RuntimeException("Failed to convert old auth token", e);
logger.error("Failed to convert old auth token, if this keeps happening please remove " + oldLiveAuth + " and reauthenticate", e);
}
}
}
@@ -120,7 +120,7 @@ private void initialise() {
try {
if (Files.exists(cache)) xstsToken = xstsAuth.fromJson(JsonUtil.parseString(Files.readString(cache)).getAsJsonObject());
} catch (IOException e) {
throw new RuntimeException("Failed to load cache.json", e);
logger.error("Failed to load cache.json", e);
}

try {
@@ -139,7 +139,7 @@ private void initialise() {
// Construct and store the Xbox token info
xboxTokenInfo = new XboxTokenInfo(xstsToken.getDisplayClaims().get("xid"), xstsToken.getUserHash(), xstsToken.getDisplayClaims().get("gtg"), xstsToken.getToken(), String.valueOf(xstsToken.getExpireTimeMs()));
} catch (Exception e) {
throw new RuntimeException(e);
logger.error("Failed to get/refresh auth token", e);
}
}

0 comments on commit 1f95c79

Please sign in to comment.