Skip to content

Commit 4f4a375

Browse files
cardenasj97Juan Cardenas
andauthored
fix: update type, remove unused imports, define AuthEvent type (#47)
## What kind of change does this PR introduce? fix type, remove unused imports, fix comments ## What is the current behavior? - ## What is the new behavior? - ## Additional context Add any other context or screenshots. --------- Co-authored-by: Juan Cardenas <[email protected]>
1 parent e046a1f commit 4f4a375

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/createServerClient.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { createClient, SupabaseClient } from "@supabase/supabase-js";
1+
import {
2+
AuthChangeEvent,
3+
createClient,
4+
SupabaseClient,
5+
} from "@supabase/supabase-js";
26
import type {
37
GenericSchema,
48
SupabaseClientOptions,
59
} from "@supabase/supabase-js/dist/module/lib/types";
610

711
import { VERSION } from "./version";
8-
import {
9-
DEFAULT_COOKIE_OPTIONS,
10-
combineChunks,
11-
createChunks,
12-
deleteChunks,
13-
isBrowser,
14-
isChunkLike,
15-
} from "./utils";
1612
import { createStorageFromOptions, applyServerStorage } from "./cookies";
1713
import type {
1814
CookieOptionsWithName,
@@ -75,7 +71,7 @@ export function createServerClient<
7571
* **Use in pages, components or routes.**
7672
*
7773
* To use Supabase features server-side rendered in pages, components or routes
78-
* (a.k.a. actions / APIs) you must create a client with this funciton. Not all
74+
* (a.k.a. actions / APIs) you must create a client with this function. Not all
7975
* frameworks allow the ability to set cookies or response headers when pages
8076
* or components are rendered. In those cases you _can omit `setAll` (or the
8177
* deprecated `set`, `remove`) cookie option methods_. **It is strongly
@@ -180,7 +176,7 @@ export function createServerClient<
180176
},
181177
);
182178

183-
client.auth.onAuthStateChange(async (event) => {
179+
client.auth.onAuthStateChange(async (event: AuthChangeEvent) => {
184180
// The SIGNED_IN event is fired very often, but we don't need to
185181
// apply the storage each time it fires, only if there are changes
186182
// that need to be set -- which is if setItems / removeItems have

0 commit comments

Comments
 (0)