omniauth-gitlab: Fix callback_url for relative_urls
What does this MR do and why?
- One of the breaking changes in OmniAuth 2.0+ relates to how relative URL installations are handled. See: https://github.com/omniauth/omniauth/pull/903 and https://github.com/omniauth/omniauth/wiki/Upgrading-to-2.0#relative-root-apps
- As a result, when
omniauth-gitlab
is used with OmniAuth 2.0+ for an app that lives at a relative URl, the#callback_url
is incorrect (the relative URL is included twice). - This is because OmniAuth is now prefixing the default
Strategy#request_path and Strategy#callback_path with SCRIPT_NAME, but
omniauth-gitlab
is also addingscript_name
tocallback_url
. https://github.com/omniauth/omniauth-oauth2/pull/152#issuecomment-1159512977 - Similar change to omniauth-google-oauth2 was made here: https://github.com/zquestz/omniauth-google-oauth2/pull/403
- Similar change to omniauth-google-azure-activedirectory-v2 was made here: https://github.com/RIPAGlobal/omniauth-azure-activedirectory-v2/pull/6
- Fixes !97985 (comment 1101545432)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jessie Young