Fix expiration token date which return always NaN (#226)
This commit is contained in:
parent
0a80a3b073
commit
2e1ab3c266
@ -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()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user