Skip to content

Commit

Permalink
Merge branch 'feat/allow-promises-in-CookieAuthStorageAdapter' into s…
Browse files Browse the repository at this point in the history
…sr-use-storage-adapter

PR supabase#609
  • Loading branch information
prabhpreet committed Oct 8, 2023
2 parents a6b35ca + b24279d commit a5c685f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/shared/src/cookieAuthStorageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ export abstract class CookieAuthStorageAdapter implements StorageAdapter {
};
}

protected abstract getCookie(name: string): string | undefined | null;
protected abstract getCookie(
name: string
): string | undefined | null | Promise<string | undefined | null>;
protected abstract setCookie(name: string, value: string): void;
protected abstract deleteCookie(name: string): void;

getItem(key: string): string | Promise<string | null> | null {
const value = this.getCookie(key);
async getItem(key: string): Promise<string | null> {
const value = await this.getCookie(key);

if (!value) return null;

Expand Down

0 comments on commit a5c685f

Please sign in to comment.