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(){
|
async function validateSelectedMicrosoftAccount(){
|
||||||
const current = ConfigManager.getSelectedAccount()
|
const current = ConfigManager.getSelectedAccount()
|
||||||
const now = new Date().getTime()
|
const now = new Date().getTime()
|
||||||
const mcExpiresAt = Date.parse(current.expiresAt)
|
const mcExpiresAt = current.expiresAt
|
||||||
const mcExpired = now >= mcExpiresAt
|
const mcExpired = now >= mcExpiresAt
|
||||||
|
|
||||||
if(!mcExpired) {
|
if(!mcExpired) {
|
||||||
@ -254,7 +254,7 @@ async function validateSelectedMicrosoftAccount(){
|
|||||||
|
|
||||||
// MC token expired. Check MS token.
|
// MC token expired. Check MS token.
|
||||||
|
|
||||||
const msExpiresAt = Date.parse(current.microsoft.expires_at)
|
const msExpiresAt = current.microsoft.expires_at
|
||||||
const msExpired = now >= msExpiresAt
|
const msExpired = now >= msExpiresAt
|
||||||
|
|
||||||
if(msExpired) {
|
if(msExpired) {
|
||||||
@ -312,4 +312,4 @@ exports.validateSelected = async function(){
|
|||||||
return await validateSelectedMojangAccount()
|
return await validateSelectedMojangAccount()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user