import type { NextAuthConfig } from "next-auth" export const authConfig = { pages: { signIn: "/auth/login", signOut: "/auth/logout", error: "/auth/error", }, callbacks: { authorized({ auth, request: { nextUrl } }) { const isLoggedIn = !!auth?.user const isOnAuthPage = nextUrl.pathname.startsWith("/auth") // Allow access to auth pages when not logged in if (isOnAuthPage) { return true } // Redirect to login if not authenticated if (!isLoggedIn) { return false } return true }, }, providers: [], // Providers will be added in auth.ts } satisfies NextAuthConfig