Skip to content

Commit

Permalink
fix: check for access token in header (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay authored Apr 20, 2024
1 parent 6d60f24 commit ae4a53d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,8 @@ export default class GoTrueClient {
throw error
}

if (!data.session?.access_token) {
const hasAccessToken = data.session?.access_token || this.headers['Authorization']
if (!hasAccessToken) {
// if there's no access token, the user can't be fetched
return { data: { user: null }, error: new AuthSessionMissingError() }
}
Expand Down

0 comments on commit ae4a53d

Please sign in to comment.