Skip to content

Commit

Permalink
fix: take type definition from supabase-js library
Browse files Browse the repository at this point in the history
  • Loading branch information
cardenasj97 committed Sep 4, 2024
1 parent 2fbfd07 commit b9ffaa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 6 additions & 3 deletions src/createServerClient.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { createClient, SupabaseClient } from "@supabase/supabase-js";
import {
AuthChangeEvent,
createClient,
SupabaseClient,
} from "@supabase/supabase-js";
import type {
GenericSchema,
SupabaseClientOptions,
Expand All @@ -10,7 +14,6 @@ import type {
CookieOptionsWithName,
CookieMethodsServer,
CookieMethodsServerDeprecated,
AuthEvent,
} from "./types";

/**
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

0 comments on commit b9ffaa9

Please sign in to comment.