Skip to content

Commit

Permalink
Fix: await get method (#657)
Browse files Browse the repository at this point in the history
* add await to get functions

* add changeset
  • Loading branch information
dijonmusters authored Oct 26, 2023
1 parent 8c0ceb5 commit 4e5df45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-ways-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@supabase/ssr': patch
---

Await get cookie function
2 changes: 1 addition & 1 deletion packages/ssr/src/createBrowserClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function createBrowserClient<
storage: {
getItem: async (key: string) => {
if (typeof cookies.get === 'function') {
return cookies.get(key);
return await cookies.get(key);
}

if (isBrowser()) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ssr/src/createServerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function createServerClient<
storage: {
getItem: async (key: string) => {
if (typeof cookies.get === 'function') {
return cookies.get(key);
return await cookies.get(key);
}
},
setItem: async (key: string, value: string) => {
Expand Down

0 comments on commit 4e5df45

Please sign in to comment.