Fix expiration token date which return always NaN (#226)

pull/239/head
DamsDev1 2022-05-21 22:08:29 +02:00 committed by GitHub
parent 0a80a3b073
commit 2e1ab3c266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,7 @@ async function validateSelectedMojangAccount(){
async function validateSelectedMicrosoftAccount(){
const current = ConfigManager.getSelectedAccount()
const now = new Date().getTime()
const mcExpiresAt = Date.parse(current.expiresAt)
const mcExpiresAt = current.expiresAt
const mcExpired = now >= mcExpiresAt
if(!mcExpired) {
@ -254,7 +254,7 @@ async function validateSelectedMicrosoftAccount(){
// MC token expired. Check MS token.
const msExpiresAt = Date.parse(current.microsoft.expires_at)
const msExpiresAt = current.microsoft.expires_at
const msExpired = now >= msExpiresAt
if(msExpired) {
@ -312,4 +312,4 @@ exports.validateSelected = async function(){
return await validateSelectedMojangAccount()
}
}
}