Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

feat(gitlab-auth): allow to configure GitLab instance

Christoph Maser3684204a0342
diff --git a/.env.sample b/.env.sample
index cbff3648..ea26e25e 100644
--- a/.env.sample
+++ b/.env.sample
@@ -246,6 +246,7 @@ NEXT_PUBLIC_GITLAB_ENABLED=
GITLAB_CUSTOM_NAME=
GITLAB_CLIENT_ID=
GITLAB_CLIENT_SECRET=
+GITLAB_AUTH_URL=
# Google
NEXT_PUBLIC_GOOGLE_ENABLED=
diff --git a/pages/api/v1/auth/[...nextauth].ts b/pages/api/v1/auth/[...nextauth].ts
index cc40daee..4e3b461c 100644
--- a/pages/api/v1/auth/[...nextauth].ts
+++ b/pages/api/v1/auth/[...nextauth].ts
@@ -659,6 +659,12 @@ if (process.env.NEXT_PUBLIC_GITLAB_ENABLED === "true") {
GitlabProvider({
clientId: process.env.GITLAB_CLIENT_ID!,
clientSecret: process.env.GITLAB_CLIENT_SECRET!,
+ authorization: {
+ url: `${process.env.GITLAB_AUTH_URL || 'https://gitlab.com'}/oauth/authorize`,
+ params: { scope: 'read_user' },
+ },
+ token: `${process.env.GITLAB_AUTH_URL || 'https://gitlab.com'}/oauth/token`,
+ userinfo: `${process.env.GITLAB_AUTH_URL || 'https://gitlab.com'}/api/v4/user`,
})
);