Add requestInterceptor to OAuth2 request authorization calls

This commit is contained in:
Kyle Shockey
2017-11-29 15:54:17 -06:00
parent 91e7ade059
commit ade47ca40e

View File

@@ -139,7 +139,7 @@ export const authorizeAccessCodeWithBasicAuthentication = ( { auth, redirectUrl
return authActions.authorizeRequest({body: buildFormData(form), name, url: schema.get("tokenUrl"), auth, headers})
}
export const authorizeRequest = ( data ) => ( { fn, authActions, errActions, authSelectors } ) => {
export const authorizeRequest = ( data ) => ( { fn, getConfigs, authActions, errActions, authSelectors } ) => {
let { body, query={}, headers={}, name, url, auth } = data
let { additionalQueryStringParams } = authSelectors.getConfigs() || {}
let fetchUrl = url
@@ -158,7 +158,8 @@ export const authorizeRequest = ( data ) => ( { fn, authActions, errActions, aut
method: "post",
headers: _headers,
query: query,
body: body
body: body,
requestInterceptor: getConfigs().requestInterceptor
})
.then(function (response) {
let token = JSON.parse(response.data)