aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/lib')
-rw-r--r--apps/web/lib/auth/client.ts11
-rw-r--r--apps/web/lib/providers.tsx3
2 files changed, 12 insertions, 2 deletions
diff --git a/apps/web/lib/auth/client.ts b/apps/web/lib/auth/client.ts
new file mode 100644
index 00000000..7e13f798
--- /dev/null
+++ b/apps/web/lib/auth/client.ts
@@ -0,0 +1,11 @@
+"use client";
+
+/**
+ * Centralized client-side auth utilities.
+ * This module re-exports next-auth/react functions to allow for easier
+ * future migration to a different auth provider.
+ */
+
+export { SessionProvider, signIn, signOut, useSession } from "next-auth/react";
+
+export type { Session } from "next-auth";
diff --git a/apps/web/lib/providers.tsx b/apps/web/lib/providers.tsx
index a3debdb9..dd4e62e7 100644
--- a/apps/web/lib/providers.tsx
+++ b/apps/web/lib/providers.tsx
@@ -1,14 +1,13 @@
"use client";
import type { UserLocalSettings } from "@/lib/userLocalSettings/types";
-import type { Session } from "next-auth";
import React, { useState } from "react";
import { ThemeProvider } from "@/components/theme-provider";
import { TooltipProvider } from "@/components/ui/tooltip";
+import { Session, SessionProvider } from "@/lib/auth/client";
import { UserLocalSettingsCtx } from "@/lib/userLocalSettings/bookmarksLayout";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { httpBatchLink, loggerLink } from "@trpc/client";
-import { SessionProvider } from "next-auth/react";
import superjson from "superjson";
import type { ClientConfig } from "@karakeep/shared/config";