-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.ts
More file actions
18 lines (15 loc) · 677 Bytes
/
Copy pathauth.ts
File metadata and controls
18 lines (15 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import NextAuth, { NextAuthOptions } from "next-auth";
import GitHubProvider from "next-auth/providers/github";
export const authOptions: NextAuthOptions = {
providers: [
GitHubProvider({
clientId: process.env.AUTH_GITHUB_ID || "",
clientSecret: process.env.AUTH_GITHUB_SECRET || "",
}),
],
secret: process.env.NEXTAUTH_SECRET, // Ensure this matches the value in .env
debug: process.env.NODE_ENV === "development", // Debug mode in development
trustHost: process.env.NODE_ENV === "development", // Trust localhost in development
};
const { handlers, auth, signIn, signOut } = NextAuth(authOptions);
export { handlers, auth, signIn, signOut };