mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-05 23:40:57 +00:00
27 lines
698 B
TypeScript
27 lines
698 B
TypeScript
import NextAuth, { NextAuthResult } from "next-auth";
|
|
import Google from "next-auth/providers/google";
|
|
import { DrizzleAdapter } from "@auth/drizzle-adapter";
|
|
import { db } from "./db";
|
|
import { accounts, sessions, users, verificationTokens } from "./db/schema";
|
|
|
|
export const {
|
|
handlers: { GET, POST },
|
|
signIn,
|
|
signOut,
|
|
auth,
|
|
} = NextAuth({
|
|
secret: process.env.BACKEND_SECURITY_KEY,
|
|
trustHost: true,
|
|
adapter: DrizzleAdapter(db, {
|
|
usersTable: users,
|
|
accountsTable: accounts,
|
|
sessionsTable: sessions,
|
|
verificationTokensTable: verificationTokens,
|
|
}),
|
|
providers: [
|
|
Google({
|
|
clientId: process.env.GOOGLE_CLIENT_ID,
|
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
|
}),
|
|
],
|
|
});
|