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
Collaborator

@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
18 checks passed
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