mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
feat: login page with nextauth.js
This commit is contained in:
parent
599c59bb38
commit
a0f3aed326
7 changed files with 77 additions and 3 deletions
23
src/app/api/auth/[...nextauth]/route.ts
Normal file
23
src/app/api/auth/[...nextauth]/route.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import NextAuth, { AuthOptions } from "next-auth";
|
||||
import Discord from "next-auth/providers/discord";
|
||||
import Github from "next-auth/providers/github";
|
||||
|
||||
export const authOptions: AuthOptions = {
|
||||
pages: {
|
||||
signIn: "/login",
|
||||
},
|
||||
providers: [
|
||||
Discord({
|
||||
clientId: process.env.DISCORD_ID!,
|
||||
clientSecret: process.env.DISCORD_SECRET!,
|
||||
}),
|
||||
Github({
|
||||
clientId: process.env.GITHUB_ID!,
|
||||
clientSecret: process.env.GITHUB_SECRET!,
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
Loading…
Add table
Add a link
Reference in a new issue