refactor(auth): use google provider
This commit is contained in:
parent
b91d83a5d7
commit
ebeabbcdbf
3 changed files with 13 additions and 11 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Reference in a new issue