diff --git a/lib/core/auth.js b/lib/core/auth.js index 3fc9a3160..7db9cf9cc 100644 --- a/lib/core/auth.js +++ b/lib/core/auth.js @@ -287,11 +287,12 @@ export default class Auth { const _endpoint = Object.assign({}, defaults, endpoint) + const tokenName = this.strategies[strategy].options.tokenName || 'Authorization' if (!_endpoint.headers) { _endpoint.headers = {} } - if (!_endpoint.headers['Authorization'] && isSet(token) && token) { - _endpoint.headers['Authorization'] = token + if (!_endpoint.headers[tokenName] && isSet(token) && token) { + _endpoint.headers[tokenName] = token } return this.request(_endpoint)