(id: string, clientId: string, clientSecret: string, baseUrl: string)
| 221 | } |
| 222 | |
| 223 | const createGitLabProvider = async (id: string, clientId: string, clientSecret: string, baseUrl: string) => { |
| 224 | return Gitlab({ |
| 225 | id, |
| 226 | clientId: clientId, |
| 227 | clientSecret: clientSecret, |
| 228 | authorization: { |
| 229 | url: `${baseUrl}/oauth/authorize`, |
| 230 | params: { |
| 231 | scope: [ |
| 232 | "read_user", |
| 233 | // Permission syncing requires the `read_api` scope in order to fetch projects |
| 234 | // for the authenticated user and project members. |
| 235 | // @see: https://docs.gitlab.com/ee/api/projects.html#list-all-projects |
| 236 | ...(env.PERMISSION_SYNC_ENABLED === 'true' && await hasEntitlement('permission-syncing') ? |
| 237 | ['read_api'] : |
| 238 | [] |
| 239 | ), |
| 240 | ].join(' '), |
| 241 | }, |
| 242 | }, |
| 243 | token: { |
| 244 | url: `${baseUrl}/oauth/token`, |
| 245 | }, |
| 246 | userinfo: { |
| 247 | url: `${baseUrl}/api/v4/user`, |
| 248 | }, |
| 249 | allowDangerousEmailAccountLinking: env.AUTH_EE_ALLOW_EMAIL_ACCOUNT_LINKING === 'true', |
| 250 | }); |
| 251 | } |
| 252 | |
| 253 | const createGoogleProvider = (id: string, clientId: string, clientSecret: string) => { |
| 254 | return Google({ |
no test coverage detected