Files
Homarr/packages/auth/index.ts
Meier Lukas eb21628ee4 refactor: replace signIn callback with signIn event, adjust getUserByEmail in adapter to check provider (#1223)
* refactor: replace signIn callback with signIn event, adjust getUserByEmail in adapter to check provider

* test: adjusting tests for adapter and events

* docs: add comments for unknown auth provider

* fix: missing dayjs import
2024-10-07 21:13:15 +02:00

26 lines
800 B
TypeScript

import { headers } from "next/headers";
import type { DefaultSession } from "@auth/core/types";
import type { ColorScheme, GroupPermissionKey, SupportedAuthProvider } from "@homarr/definitions";
import { createConfiguration } from "./configuration";
export type { Session } from "next-auth";
declare module "next-auth" {
interface Session {
user: {
id: string;
permissions: GroupPermissionKey[];
colorScheme: ColorScheme;
} & DefaultSession["user"];
}
}
export * from "./security";
// See why it's unknown in the [...nextauth]/route.ts file
export const createHandlers = (provider: SupportedAuthProvider | "unknown") => createConfiguration(provider, headers());
export { getSessionFromTokenAsync as getSessionFromToken, sessionTokenCookieName } from "./session";