1
0
Fork 0

refactor(auth): use google provider

This commit is contained in:
Vojtěch Mareš 2023-06-26 23:09:18 +02:00
parent b91d83a5d7
commit ebeabbcdbf
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
3 changed files with 13 additions and 11 deletions

View file

@ -5,7 +5,7 @@ import {
type NextAuthOptions,
type DefaultSession,
} from "next-auth";
import DiscordProvider from "next-auth/providers/discord";
import GoogleProvider from "next-auth/providers/google";
import { env } from "~/env.mjs";
import { prisma } from "~/server/db";
@ -42,14 +42,16 @@ export const authOptions: NextAuthOptions = {
user: {
...session.user,
id: user.id,
email: user.email,
image: user.image,
},
}),
},
adapter: PrismaAdapter(prisma),
providers: [
DiscordProvider({
clientId: env.DISCORD_CLIENT_ID,
clientSecret: env.DISCORD_CLIENT_SECRET,
GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
/**
* ...add more providers here.