Skip to content

gitlab: use baseURL to match the correct OAuth context

Administrator requested to merge jc/gitlab-get-oauth-context into main

Created by: unknwon

Previously in https://github.com/sourcegraph/sourcegraph/pull/39840, we would always pick the first GitLab auth provider to obtain the OAuth context, which isn't a problem when there is only one GitLab auth provider configured (in most of the cases). However, this would give us incorrect OAuth context when there are more than one GitLab auth providers configured.

This PR fixes that by using the root URL for determining the correct auth provider to get OAuth context.

Test plan

Unit tests


Followup of https://github.com/sourcegraph/sourcegraph/pull/39840#discussion_r951759885

Merge request reports

Loading