Skip to content

Commit

Permalink
Add discord provider
Browse files Browse the repository at this point in the history
  • Loading branch information
awtkns committed Apr 15, 2023
1 parent 24895c9 commit 40429dc
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import {
} from "next-auth";
import GithubProvider from "next-auth/providers/github";
import GoogleProvider from "next-auth/providers/google";
import DiscordProvider from "next-auth/providers/discord";
import { PrismaAdapter } from "@next-auth/prisma-adapter";
import { prisma } from "./db";
import { env } from "../env/server.mjs";
import { serverEnv } from "../env/schema.mjs";

/**
* Module augmentation for `next-auth` types
Expand All @@ -33,13 +34,18 @@ declare module "next-auth" {

const providers = [
GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID ?? "",
clientSecret: env.GOOGLE_CLIENT_SECRET ?? "",
clientId: serverEnv.GOOGLE_CLIENT_ID ?? "",
clientSecret: serverEnv.GOOGLE_CLIENT_SECRET ?? "",
allowDangerousEmailAccountLinking: true,
}),
GithubProvider({
clientId: env.GITHUB_CLIENT_ID ?? "",
clientSecret: env.GITHUB_CLIENT_SECRET ?? "",
clientId: serverEnv.GITHUB_CLIENT_ID ?? "",
clientSecret: serverEnv.GITHUB_CLIENT_SECRET ?? "",
allowDangerousEmailAccountLinking: true,
}),
DiscordProvider({
clientId: serverEnv.DISCORD_CLIENT_ID ?? "",
clientSecret: serverEnv.DISCORD_CLIENT_SECRET ?? "",
allowDangerousEmailAccountLinking: true,
}),
];
Expand Down

0 comments on commit 40429dc

Please sign in to comment.