Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert check for access token in header #885

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

hf
Copy link
Contributor

@hf hf commented Apr 20, 2024

Reverts #882 due to

One thing to keep in mind is that the Authorization header will always exist since the anon key is there by default, right? So hasAccessToken will always be true; which makes this whole section of code useless, and you might as well go back to no checks.

One thing you could do when the client is created is check if the dev passed in an Authorization header. If so, set something like this.hasCustomAuthHeader = true - which would be intialized as false during client creation.

Then you could check for that on the right side of || in this getUser code.

@hf hf force-pushed the revert-882-km/fix-get-user branch from 94e1c45 to ce453ac Compare April 20, 2024 10:47
@kangmingtay kangmingtay merged commit 03d8ba7 into master Apr 25, 2024
3 checks passed
@kangmingtay kangmingtay deleted the revert-882-km/fix-get-user branch April 25, 2024 05:55
J0 pushed a commit that referenced this pull request Apr 25, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.64.0](v2.63.2...v2.64.0)
(2024-04-25)


### Features

* remove `cache: no-store` as it breaks cloudflare
([#886](#886))
([10e9d38](10e9d38))


### Bug Fixes

* Revert "fix: `getUser` returns null if there is no session
([#876](#876))"
([#889](#889))
([6755fef](6755fef))
* revert check for access token in header
([#885](#885))
([03d8ba7](03d8ba7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants