@supabase/gotrue-js
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -290,3 +290,3 @@ "use strict"; | ||
const data = JSON.parse(json); | ||
const { currentSession, currentUser, expiresAt } = data; | ||
const { currentSession, expiresAt } = data; | ||
const timeNow = Math.round(Date.now() / 1000); | ||
@@ -297,5 +297,9 @@ if (expiresAt < timeNow) { | ||
} | ||
else if (!currentSession || !currentSession.user) { | ||
console.log('Current session is missing data.'); | ||
this._removeSession(); | ||
} | ||
else { | ||
this.currentSession = currentSession; | ||
this.currentUser = currentUser; | ||
this.currentUser = currentSession.user; | ||
// schedule a refresh 60 seconds before token due to expire | ||
@@ -302,0 +306,0 @@ setTimeout(this._callRefreshToken, (expiresAt - timeNow - 60) * 1000); |
@@ -285,3 +285,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const data = JSON.parse(json); | ||
const { currentSession, currentUser, expiresAt } = data; | ||
const { currentSession, expiresAt } = data; | ||
const timeNow = Math.round(Date.now() / 1000); | ||
@@ -292,5 +292,9 @@ if (expiresAt < timeNow) { | ||
} | ||
else if (!currentSession || !currentSession.user) { | ||
console.log('Current session is missing data.'); | ||
this._removeSession(); | ||
} | ||
else { | ||
this.currentSession = currentSession; | ||
this.currentUser = currentUser; | ||
this.currentUser = currentSession.user; | ||
// schedule a refresh 60 seconds before token due to expire | ||
@@ -297,0 +301,0 @@ setTimeout(this._callRefreshToken, (expiresAt - timeNow - 60) * 1000); |
{ | ||
"name": "@supabase/gotrue-js", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Isomorphic GoTrue client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
113063
1822