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: Broken authentication on dev #215

Merged
merged 2 commits into from
Jul 15, 2023
Merged

fix: Broken authentication on dev #215

merged 2 commits into from
Jul 15, 2023

Conversation

Anush008
Copy link
Member

@Anush008 Anush008 commented Jul 15, 2023

Description

This PR intends to fix the broken dev auth due to a changed cookie key.
The auth cookie name at https://beta.insights.opensauced.pizza is sb-fcqqkxwlntnrtjfbcioz-auth-token. At https://insights.opensauced.pizza it is supabase-auth-token.

The useAuth hook has been improved to check and propagate auth. The checkAuthentication function has been removed along with the onInstalled, onStartup and cookies.onChanged background listeners as the useAuth hook will suffice from here on.

Any future changes to the key will have to be updated here.

export const SUPABASE_AUTH_COOKIE_NAME = import.meta.env.PROD ? "supabase-auth-token" : `sb-${import.meta.env.VITE_OPEN_SAUCED_SUPABASE_ID}-auth-token`;

The rest of the authentication can remain unchanged.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Resolves #214.

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 docs.opensauced.pizza
  • 🍕 dev.to/opensauced
  • 📕 storybook
  • 🙅 no documentation needed

@Anush008 Anush008 requested review from diivi and bdougie July 15, 2023 06:08
Copy link
Contributor

@diivi diivi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works!

@bdougie
Copy link
Member

bdougie commented Jul 15, 2023

Curious if this is the same issue happening hot.opensauced.pizza - open-sauced/hot#477

At lease the cookie name checks.

@Anush008
Copy link
Member Author

Curious if this is the same issue happening hot.opensauced.pizza - open-sauced/hot#477

The VITE_API_URL of beta.hot.opensauced.pizza is broken, https://lkkownkrbkmblczeoyqb.supabase.co/.

While the one for hot.opensauced.pizza, https://ibcwmlhcimymasokhgvn.supabase.co/, is working fine.

Copy link
Member

@bdougie bdougie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this

@bdougie bdougie merged commit c6bf2c8 into beta Jul 15, 2023
github-actions bot pushed a commit that referenced this pull request Jul 15, 2023
## [1.11.1-beta.2](v1.11.1-beta.1...v1.11.1-beta.2) (2023-07-15)

### 🐛 Bug Fixes

* Broken authentication on dev ([#215](#215)) ([c6bf2c8](c6bf2c8))
@github-actions
Copy link

🎉 This PR is included in version 1.11.1-beta.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Jul 18, 2023
## [1.11.1](v1.11.0...v1.11.1) (2023-07-18)

### ✅ Tests

* api responses match our expectations ([#216](#216)) ([7f79b0a](7f79b0a))

### 🐛 Bug Fixes

* Broken authentication on dev ([#215](#215)) ([c6bf2c8](c6bf2c8))
@github-actions
Copy link

🎉 This PR is included in version 1.11.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

zer0and1 added a commit to zer0and1/open-sauced.ai that referenced this pull request Jul 26, 2023
## [1.11.1-beta.2](open-sauced/ai@v1.11.1-beta.1...v1.11.1-beta.2) (2023-07-15)

### 🐛 Bug Fixes

* Broken authentication on dev ([#215](open-sauced/ai#215)) ([c6bf2c8](open-sauced/ai@c6bf2c8))
zer0and1 pushed a commit to zer0and1/open-sauced.ai that referenced this pull request Jul 26, 2023
## [1.11.1](open-sauced/ai@v1.11.0...v1.11.1) (2023-07-18)

### ✅ Tests

* api responses match our expectations ([#216](open-sauced/ai#216)) ([7f79b0a](open-sauced/ai@7f79b0a))

### 🐛 Bug Fixes

* Broken authentication on dev ([#215](open-sauced/ai#215)) ([c6bf2c8](open-sauced/ai@c6bf2c8))
@Anush008 Anush008 deleted the fix-dev-auth branch August 1, 2023 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Broken authentication on dev build
3 participants