fix(gitlab): fix the token endpoint (#5147)

This commit is contained in:
Tobias Heinze
2025-10-07 16:36:10 +02:00
committed by GitHub
parent 5c8a7eb79b
commit 589df44a9f
2 changed files with 27 additions and 1 deletions

View File

@@ -28,6 +28,32 @@ description: GitLab provider setup and usage.
},
})
```
#### Configuration Options
- `clientId`: Your GitLab application's Client ID
- `clientSecret`: Your GitLab application's Client Secret
- `issuer`: (Optional) The URL of your GitLab instance. Use this for self-hosted GitLab servers.
- Default: `"https://gitlab.com"` (GitLab.com)
- Example: `"https://gitlab.company.com"`
<Callout type="info">
The `issuer` option is useful when using a self-hosted GitLab instance. If you're using GitLab.com, you can omit this option as it defaults to `https://gitlab.com`.
</Callout>
#### Example with self-hosted GitLab
```ts title="auth.ts"
export const auth = betterAuth({
socialProviders: {
gitlab: {
clientId: process.env.GITLAB_CLIENT_ID as string,
clientSecret: process.env.GITLAB_CLIENT_SECRET as string,
issuer: "https://gitlab.company.com", // Your self-hosted GitLab URL // [!code highlight]
},
},
})
```
</Step>
<Step>
### Sign In with GitLab

View File

@@ -120,7 +120,7 @@ export const gitlab = (options: GitlabOptions) => {
clientKey: options.clientKey,
clientSecret: options.clientSecret,
},
tokenEndpoint: "https://gitlab.com/oauth/token",
tokenEndpoint: tokenEndpoint,
});
},
async getUserInfo(token) {