Skip to content

Commit

Permalink
add google provider (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewmorris authored Nov 2, 2024
1 parent 0a44724 commit 9cca117
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const env = createEnv({
DISCORD_CLIENT_SECRET: z.string(),
GITHUB_ID: z.string(),
GITHUB_SECRET: z.string(),
GOOGLE_ID: z.string(),
GOOGLE_SECRET: z.string(),
},

/**
Expand All @@ -49,6 +51,8 @@ export const env = createEnv({
DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
GITHUB_ID: process.env.GITHUB_ID,
GITHUB_SECRET: process.env.GITHUB_SECRET,
GOOGLE_ID: process.env.GOOGLE_ID,
GOOGLE_SECRET: process.env.GOOGLE_SECRET,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
Expand Down
9 changes: 7 additions & 2 deletions src/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from "next-auth";
import DiscordProvider from "next-auth/providers/discord";
import GitHubProvider from "next-auth/providers/github";
import GoogleProvider from "next-auth/providers/google";

import { env } from "~/env";
import { prisma } from "~/server/db";
Expand Down Expand Up @@ -56,8 +57,12 @@ export const authOptions: NextAuthOptions = {
GitHubProvider({
clientId: env.GITHUB_ID,
clientSecret: env.GITHUB_SECRET
})

}),
GoogleProvider({
clientId: env.GOOGLE_ID,
clientSecret: env.GOOGLE_SECRET
}),

/**
* ...add more providers here.
*
Expand Down

0 comments on commit 9cca117

Please sign in to comment.