Skip to content

Conversation

csenio
Copy link

@csenio csenio commented Jul 16, 2023

What kind of change does this PR introduce?

feature / chore

What is the current behavior?

CookieAuthStorageAdapter doesn't await the response of this.getCookie(key).
This limits how much it can be extended as methods like chrome.cookies.getAll always run asynchronously.

What is the new behavior?

getItem in the CookieAuthStorageAdapter is now an async function that awaits the result of this.getCookie(key).
This should not cause any changes in behaviour and is in line with how getItem works in the goTrueClient storage adapter.

Additional context

My personal use case is that I'm making an adapter to use supabase auth in my extension service worker and I prefer extending CookieAuthStorageAdapter over StorageAdapter. I figured other people trying to extend it will run into the same issue eventually so making a PR.

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.

1 participant