From 2e1ab3c2660a209bbaa763ad842131866b09eb98 Mon Sep 17 00:00:00 2001 From: DamsDev1 <60252259+DamsDev1@users.noreply.github.com> Date: Sat, 21 May 2022 22:08:29 +0200 Subject: [PATCH] Fix expiration token date which return always NaN (#226) --- app/assets/js/authmanager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/js/authmanager.js b/app/assets/js/authmanager.js index cdc6905..3f43144 100644 --- a/app/assets/js/authmanager.js +++ b/app/assets/js/authmanager.js @@ -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() } -} \ No newline at end of file +}