diff --git a/src/GoTrueClient.ts b/src/GoTrueClient.ts index 9a38e9d7..fa08a8e6 100644 --- a/src/GoTrueClient.ts +++ b/src/GoTrueClient.ts @@ -362,7 +362,7 @@ export default class GoTrueClient { */ private async _initialize(): Promise { try { - const params = parseParametersFromURL(window.location.href) + const params = isBrowser() ? parseParametersFromURL(window.location.href) : {} let callbackUrlType = 'none' if (this._isImplicitGrantCallback(params)) { callbackUrlType = 'implicit' @@ -2144,7 +2144,7 @@ export default class GoTrueClient { maybeSession !== null && 'access_token' in maybeSession && 'refresh_token' in maybeSession && - 'expires_at' in maybeSession + 'expires_in' in maybeSession return isValidSession }