diff --git a/src/createServerClient.ts b/src/createServerClient.ts index a803759..c4f3d6a 100644 --- a/src/createServerClient.ts +++ b/src/createServerClient.ts @@ -1,4 +1,8 @@ -import { createClient, SupabaseClient } from "@supabase/supabase-js"; +import { + AuthChangeEvent, + createClient, + SupabaseClient, +} from "@supabase/supabase-js"; import type { GenericSchema, SupabaseClientOptions, @@ -10,7 +14,6 @@ import type { CookieOptionsWithName, CookieMethodsServer, CookieMethodsServerDeprecated, - AuthEvent, } from "./types"; /** @@ -173,7 +176,7 @@ export function createServerClient< }, ); - client.auth.onAuthStateChange(async (event: AuthEvent) => { + client.auth.onAuthStateChange(async (event: AuthChangeEvent) => { // The SIGNED_IN event is fired very often, but we don't need to // apply the storage each time it fires, only if there are changes // that need to be set -- which is if setItems / removeItems have diff --git a/src/types.ts b/src/types.ts index 460b43a..043f363 100644 --- a/src/types.ts +++ b/src/types.ts @@ -47,11 +47,3 @@ export type CookieMethodsServer = { getAll: GetAllCookies; setAll?: SetAllCookies; }; - -export type AuthEvent = - | "SIGNED_IN" - | "TOKEN_REFRESHED" - | "USER_UPDATED" - | "PASSWORD_RECOVERY" - | "SIGNED_OUT" - | "MFA_CHALLENGE_VERIFIED";