diff --git a/packages/reservation-platform/.env.example b/packages/reservation-platform/.env.example index eb5aed4..ccebac0 100644 --- a/packages/reservation-platform/.env.example +++ b/packages/reservation-platform/.env.example @@ -20,6 +20,6 @@ DATABASE_URL="file:./db.sqlite" # NEXTAUTH_SECRET="" NEXTAUTH_URL="http://localhost:3000" -# Next Auth Discord Provider -DISCORD_CLIENT_ID="" -DISCORD_CLIENT_SECRET="" +# Next Auth GitHub Provider +GITHUB_CLIENT_ID="" +GITHUB_CLIENT_SECRET="" diff --git a/packages/reservation-platform/src/env.js b/packages/reservation-platform/src/env.js index 2467d22..c051865 100644 --- a/packages/reservation-platform/src/env.js +++ b/packages/reservation-platform/src/env.js @@ -22,8 +22,8 @@ export const env = createEnv({ // VERCEL_URL doesn't include `https` so it cant be validated as a URL process.env.VERCEL ? z.string() : z.string().url() ), - DISCORD_CLIENT_ID: z.string(), - DISCORD_CLIENT_SECRET: z.string(), + GITHUB_CLIENT_ID: z.string(), + GITHUB_CLIENT_SECRET: z.string(), }, /** @@ -44,8 +44,8 @@ export const env = createEnv({ NODE_ENV: process.env.NODE_ENV, NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, NEXTAUTH_URL: process.env.NEXTAUTH_URL, - DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID, - DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET, + GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID, + GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET, }, /** * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially diff --git a/packages/reservation-platform/src/server/auth.ts b/packages/reservation-platform/src/server/auth.ts index 14ce0de..c9f36e2 100644 --- a/packages/reservation-platform/src/server/auth.ts +++ b/packages/reservation-platform/src/server/auth.ts @@ -5,7 +5,7 @@ import { type NextAuthOptions, } from "next-auth"; import { type Adapter } from "next-auth/adapters"; -import DiscordProvider from "next-auth/providers/discord"; +import GitHubProvider from "next-auth/providers/github"; import { env } from "@/env"; import { db } from "@/server/db"; @@ -48,14 +48,14 @@ export const authOptions: NextAuthOptions = { }, adapter: PrismaAdapter(db) as Adapter, providers: [ - DiscordProvider({ - clientId: env.DISCORD_CLIENT_ID, - clientSecret: env.DISCORD_CLIENT_SECRET, + GitHubProvider({ + clientId: env.GITHUB_CLIENT_ID, + clientSecret: env.GITHUB_CLIENT_SECRET, }), /** * ...add more providers here. * - * Most other providers require a bit more work than the Discord provider. For example, the + * Most other providers require a bit more work than the GITHUB provider. For example, the * GitHub provider requires you to add the `refresh_token_expires_in` field to the Account * model. Refer to the NextAuth.js docs for the provider you want to use. Example: *