Skip to content

Commit 2e1ab3c

Browse files
authored
Fix expiration token date which return always NaN (#226)
1 parent 0a80a3b commit 2e1ab3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/assets/js/authmanager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ async function validateSelectedMojangAccount(){
245245
async function validateSelectedMicrosoftAccount(){
246246
const current = ConfigManager.getSelectedAccount()
247247
const now = new Date().getTime()
248-
const mcExpiresAt = Date.parse(current.expiresAt)
248+
const mcExpiresAt = current.expiresAt
249249
const mcExpired = now >= mcExpiresAt
250250

251251
if(!mcExpired) {
@@ -254,7 +254,7 @@ async function validateSelectedMicrosoftAccount(){
254254

255255
// MC token expired. Check MS token.
256256

257-
const msExpiresAt = Date.parse(current.microsoft.expires_at)
257+
const msExpiresAt = current.microsoft.expires_at
258258
const msExpired = now >= msExpiresAt
259259

260260
if(msExpired) {
@@ -312,4 +312,4 @@ exports.validateSelected = async function(){
312312
return await validateSelectedMojangAccount()
313313
}
314314

315-
}
315+
}

0 commit comments

Comments
 (0)