diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-06 12:26:29 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-06 12:26:29 +0000 |
| commit | 083ea5bd19172381bb53e95aaf98eaabef839c54 (patch) | |
| tree | 4d1c041aab7cd8d15382330db08caeb9c5a12c63 /lib/auth.ts | |
| parent | b792121977ade8bdd3fb62704b65a9fcbd1436b9 (diff) | |
| download | karakeep-083ea5bd19172381bb53e95aaf98eaabef839c54.tar.zst | |
Move the web app into a subdir
Diffstat (limited to 'lib/auth.ts')
| -rw-r--r-- | lib/auth.ts | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/auth.ts b/lib/auth.ts deleted file mode 100644 index 9b21e605..00000000 --- a/lib/auth.ts +++ /dev/null @@ -1,25 +0,0 @@ -import NextAuth, { NextAuthOptions } from "next-auth" -import { PrismaAdapter } from "@next-auth/prisma-adapter" -import AuthentikProvider from "next-auth/providers/authentik"; -import serverConfig from "@/lib/config"; -import prisma from "@/lib/prisma"; - -let providers = []; - -if (serverConfig.auth.authentik) { - providers.push(AuthentikProvider(serverConfig.auth.authentik)); -} - -export const authOptions: NextAuthOptions = { - // Configure one or more authentication providers - adapter: PrismaAdapter(prisma), - providers: providers, - callbacks: { - session({ session, token, user }) { - session.user = { ...user }; - return session; - } - } -}; - -export const authHandler = NextAuth(authOptions); |
