From 6755fef2aefd1bc84a26182f848c0912492cb106 Mon Sep 17 00:00:00 2001 From: Joel Lee Date: Thu, 25 Apr 2024 14:05:26 +0800 Subject: [PATCH] fix: Revert "fix: `getUser` returns null if there is no session (#876)" (#889) This reverts commit 6adf8caa4ca803e65f943cc88a2849f5905a044a. Revert check for access token before fetching user. While potentially beneficial, we'll need to update our guides and address a few other issues before we can proceed with this change --- src/GoTrueClient.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/GoTrueClient.ts b/src/GoTrueClient.ts index ec193a60f..70dcb8c37 100644 --- a/src/GoTrueClient.ts +++ b/src/GoTrueClient.ts @@ -1174,11 +1174,6 @@ export default class GoTrueClient { throw error } - if (!data.session?.access_token) { - // if there's no access token, the user can't be fetched - return { data: { user: null }, error: new AuthSessionMissingError() } - } - return await _request(this.fetch, 'GET', `${this.url}/user`, { headers: this.headers, jwt: data.session?.access_token ?? undefined,