refactor: Combine the storage interface for storage and pkce in gotrue_client#1087
refactor: Combine the storage interface for storage and pkce in gotrue_client#1087
Conversation
c006dd1 to
0ae2b71
Compare
|
Thanks for this PR, but honestly, I am not a huge fan of these refactorings. I feel like the library is deviating more and more from supabase-js, which makes it hard to maintain. Unless there is something broken, I'd say we keep it the way it is, and maybe we can revisit it when a major version release comes. |
|
I'm quite confused, because the whole goal of this pr is to align with supabase-js .
So this pr makes it easier to maintain the similarity to the js sdk. |
|
It's a refactoring that doesn't really solve any issues that users are asking for. We can probably wait for a major version bump for changes like this. |
|
This pull request has been inactive for 90 days. If you plan to continue working on this PR, please leave a comment to keep it open. |
|
This pull request was automatically closed due to inactivity. If you'd like to continue this work, please reopen the PR or create a new one. |
What kind of change does this PR introduce?
refactor
What is the current behavior?
The session gets stored by the supabase_flutter package by listening to auth events. The session is stored in a different place than the pkce token.
What is the new behavior?
The gotrue package manages the session storage itself (like in supabase-js) and uses the same interface as the pkce token.
Reasons for this pr:
persistSessionfield, which is now used to explicitly turn on the session broadcasting. close Version 2.7.0 prevents reading data on web under certain conditions #1085I deprecated both
localStorage(used for session storage bysupabase_flutter) andpkceAsyncStorage(used bysupabaseto store the pkce token) and replace them with a unified storage interfaceasyncStorage, which uses theGotrueAsyncStorageclass, which was previsouly used for pkce only. To support existing configuration I created a new class, which combines both deprecated interfaces into one and decides by the suffix of the storage key to use the session storage or pkce storage.Additionally, I noticed that many document comments were outdated, because of the 'new' options classes for each package, so I updated them.
Additional context