Add requestInterceptor to OAuth2 request authorization calls
This commit is contained in:
@@ -139,7 +139,7 @@ export const authorizeAccessCodeWithBasicAuthentication = ( { auth, redirectUrl
|
|||||||
return authActions.authorizeRequest({body: buildFormData(form), name, url: schema.get("tokenUrl"), auth, headers})
|
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 { body, query={}, headers={}, name, url, auth } = data
|
||||||
let { additionalQueryStringParams } = authSelectors.getConfigs() || {}
|
let { additionalQueryStringParams } = authSelectors.getConfigs() || {}
|
||||||
let fetchUrl = url
|
let fetchUrl = url
|
||||||
@@ -158,7 +158,8 @@ export const authorizeRequest = ( data ) => ( { fn, authActions, errActions, aut
|
|||||||
method: "post",
|
method: "post",
|
||||||
headers: _headers,
|
headers: _headers,
|
||||||
query: query,
|
query: query,
|
||||||
body: body
|
body: body,
|
||||||
|
requestInterceptor: getConfigs().requestInterceptor
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
let token = JSON.parse(response.data)
|
let token = JSON.parse(response.data)
|
||||||
|
|||||||
Reference in New Issue
Block a user