Skip to content

fix(auth): use project ref as namespace for storing token #430

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

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

grdsdev
Copy link
Collaborator

@grdsdev grdsdev commented Jun 27, 2024

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When using multiple projects, for example, a dev and a production, both environments shares the same token.

What is the new behavior?

  • Use project ref as a namespace when accessing stored token.
  • Add support for providing a custom storage key to store the token on local storage.

@grdsdev grdsdev requested a review from dshukertjr June 27, 2024 16:41
Copy link
Member

@dshukertjr dshukertjr left a comment

Choose a reason for hiding this comment

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

If a user using a version of supabase-swift prior to to this update updates to a new version with this update included, would they be signed out?

@grdsdev
Copy link
Collaborator Author

grdsdev commented Jun 28, 2024

If a user using a version of supabase-swift prior to to this update updates to a new version with this update included, would they be signed out?

No, it migrates the token to the new key: https://github.com/supabase/supabase-swift/pull/430/files#diff-6132ac0f2c100e8db5a2725259009c843e6dff71e699aadfcdf61f4b01c00192R30-R40

@grdsdev grdsdev requested a review from dshukertjr June 28, 2024 08:30
@grdsdev grdsdev force-pushed the fix/auth/project-ref-as-namespace branch from db41ada to fa64559 Compare June 28, 2024 08:30
@grdsdev grdsdev self-assigned this Jun 28, 2024
Copy link
Member

@dshukertjr dshukertjr left a comment

Choose a reason for hiding this comment

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

Sorry, missed the migration code! LGTM!

@grdsdev grdsdev merged commit 82fa93d into main Jun 28, 2024
17 checks passed
@grdsdev grdsdev deleted the fix/auth/project-ref-as-namespace branch June 28, 2024 10:40
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