From 2428db3fc007498b32d60098a004698d6b817d6a Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Fri, 6 Jun 2025 16:27:39 +0200 Subject: [PATCH] fix: handle null current session with split session storage --- src/GoTrueClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GoTrueClient.ts b/src/GoTrueClient.ts index 002ebe53..19b657bd 100644 --- a/src/GoTrueClient.ts +++ b/src/GoTrueClient.ts @@ -2153,9 +2153,9 @@ export default class GoTrueClient { this._debug(debugName, 'begin') try { - const currentSession: Session = (await getItemAsync(this.storage, this.storageKey)) as any + const currentSession = (await getItemAsync(this.storage, this.storageKey)) as Session | null - if (this.userStorage) { + if (currentSession && this.userStorage) { let maybeUser: { user: User | null } | null = (await getItemAsync( this.userStorage, this.storageKey + '-user'