From 4f2157115d1245d41b31549f0b05999a3cdf89b0 Mon Sep 17 00:00:00 2001 From: zhangtao25 Date: Mon, 9 Dec 2024 20:53:44 +0800 Subject: [PATCH] chore: daily development --- packages/canyon-platform/auth.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/canyon-platform/auth.ts b/packages/canyon-platform/auth.ts index c03556ec..c0c9d405 100644 --- a/packages/canyon-platform/auth.ts +++ b/packages/canyon-platform/auth.ts @@ -6,11 +6,13 @@ import prisma from "@/lib/prisma"; export const { handlers, auth } = NextAuth(() => { return { providers: [ - GitLab({ - // authorization: "https://git.com/oauth/authorize?scope=read_user", - // token: "https://git.com/oauth/token", - // userinfo: "https://git.com/api/v4/user", - }), + process.env.GITLAB_SERVER + ? GitLab({ + authorization: `${process.env.GITLAB_SERVER}/oauth/authorize?scope=read_user`, + token: `${process.env.GITLAB_SERVER}/oauth/token`, + userinfo: `${process.env.GITLAB_SERVER}/api/v4/user`, + }) + : GitLab, GitHub, ], // secret: process.env.AUTH_SECRET,