mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-03-29 03:29:13 +00:00
feat: google login
This commit is contained in:
parent
eaa6c97c57
commit
114526221b
3 changed files with 13 additions and 2 deletions
|
|
@ -18,6 +18,8 @@ AUTH_DISCORD_ID=XXXXXXXXXXXXXXXX
|
|||
AUTH_DISCORD_SECRET=XXXXXXXXXXXXXXXX
|
||||
AUTH_GITHUB_ID=XXXXXXXXXXXXXXXX
|
||||
AUTH_GITHUB_SECRET=XXXXXXXXXXXXXXXX
|
||||
AUTH_GOOGLE_ID=XXXXXXXXXXXXXXXX
|
||||
AUTH_GOOGLE_SECRET=XXXXXXXXXXXXXXXX
|
||||
|
||||
# Currently only supports one admin
|
||||
NEXT_PUBLIC_ADMIN_USER_ID=1
|
||||
|
|
|
|||
|
|
@ -22,6 +22,14 @@ export default function LoginButtons() {
|
|||
<Icon icon="mdi:github" fontSize={32} />
|
||||
Login with GitHub
|
||||
</button>
|
||||
<button
|
||||
onClick={() => signIn("google", { redirectTo: "/" })}
|
||||
aria-label="Login with Google"
|
||||
className="pill button gap-2 px-3! bg-white! border-gray-300! hover:bg-gray-100! text-black! flex items-center"
|
||||
>
|
||||
<Icon icon="material-icon-theme:google" fontSize={32} />
|
||||
Login with Google
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
import NextAuth from "next-auth";
|
||||
import Discord from "next-auth/providers/discord";
|
||||
import Github from "next-auth/providers/github";
|
||||
import Google from "next-auth/providers/google";
|
||||
|
||||
import { PrismaAdapter } from "@auth/prisma-adapter";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
export const { handlers, signIn, signOut, auth } = NextAuth({
|
||||
adapter: PrismaAdapter(prisma),
|
||||
providers: [Discord, Github],
|
||||
providers: [Discord, Github, Google],
|
||||
pages: {
|
||||
signIn: "/login",
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue