Skip to content

Commit

Permalink
fix: Revert "fix: getUser returns null if there is no session (#876)…
Browse files Browse the repository at this point in the history
…" (#889)

This reverts commit 6adf8ca.

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
  • Loading branch information
J0 committed Apr 25, 2024
1 parent 03d8ba7 commit 6755fef
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6755fef

Please sign in to comment.