2024-07-20 22:23:58 +02:00
|
|
|
import { headers } from "next/headers";
|
|
|
|
|
import type { DefaultSession } from "@auth/core/types";
|
2023-12-08 22:35:15 +01:00
|
|
|
|
2024-10-07 21:13:15 +02:00
|
|
|
import type { ColorScheme, GroupPermissionKey, SupportedAuthProvider } from "@homarr/definitions";
|
2024-05-04 18:34:41 +02:00
|
|
|
|
2023-12-10 17:12:20 +01:00
|
|
|
import { createConfiguration } from "./configuration";
|
2023-12-08 22:35:15 +01:00
|
|
|
|
2024-06-02 11:01:10 +02:00
|
|
|
export type { Session } from "next-auth";
|
2023-12-08 22:35:15 +01:00
|
|
|
|
2024-06-02 11:01:10 +02:00
|
|
|
declare module "next-auth" {
|
2023-12-08 22:35:15 +01:00
|
|
|
interface Session {
|
|
|
|
|
user: {
|
|
|
|
|
id: string;
|
2024-05-04 18:34:41 +02:00
|
|
|
permissions: GroupPermissionKey[];
|
2024-09-01 20:37:52 +02:00
|
|
|
colorScheme: ColorScheme;
|
2023-12-08 22:35:15 +01:00
|
|
|
} & DefaultSession["user"];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-10 17:12:20 +01:00
|
|
|
export * from "./security";
|
|
|
|
|
|
2024-10-07 21:13:15 +02:00
|
|
|
// See why it's unknown in the [...nextauth]/route.ts file
|
2025-01-04 19:47:23 +01:00
|
|
|
export const createHandlersAsync = async (provider: SupportedAuthProvider | "unknown", useSecureCookies: boolean) =>
|
|
|
|
|
createConfiguration(provider, await headers(), useSecureCookies);
|
2024-04-30 21:32:55 +02:00
|
|
|
|
2024-05-19 22:38:39 +02:00
|
|
|
export { getSessionFromTokenAsync as getSessionFromToken, sessionTokenCookieName } from "./session";
|