fix(auth): support for oauth2 relative url (#6546)

* Handle relative urls for oauth authorization

The full URL is computed based on the current selected server
if a relative URL is used as authorizationUrl
or tokenUrl


Co-authored-by: Eliot Berriot <contact@eliotberriot.com>
This commit is contained in:
Tim Lai
2020-10-21 15:46:31 -07:00
committed by GitHub
parent 07a0416ff6
commit 0a807d6237
4 changed files with 46 additions and 6 deletions

View File

@@ -174,8 +174,8 @@ export const authorizeRequest = ( data ) => ( { fn, getConfigs, authActions, err
let parsedUrl
if (specSelectors.isOAS3()) {
const server = oas3Selectors.selectedServer()
parsedUrl = parseUrl(url, oas3Selectors.serverEffectiveValue({ server }), true)
let finalServerUrl = oas3Selectors.serverEffectiveValue(oas3Selectors.selectedServer())
parsedUrl = parseUrl(url, finalServerUrl, true)
} else {
parsedUrl = parseUrl(url, specSelectors.url(), true)
}