Fixing issues with the url.search being null in Node 10 (#26992)
Node 10 uses `null` to denote the non-existence of a querystring parameter when `url.parse(urlString, true)` is used, the following changes fix our usages within the security plugin.
This commit is contained in:
parent
459cbe43a5
commit
774ce42242
|
@ -86,7 +86,7 @@ export class BasicAuthenticationProvider {
|
|||
// Query string may contain the path where logout has been called or
|
||||
// logout reason that login page may need to know.
|
||||
return DeauthenticationResult.redirectTo(
|
||||
`${this._options.basePath}/login${request.url.search}`
|
||||
`${this._options.basePath}/login${request.url.search || ''}`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -403,7 +403,7 @@ export class SAMLAuthenticationProvider {
|
|||
logoutArgs = [
|
||||
'shield.samlInvalidate',
|
||||
// Elasticsearch expects `queryString` without leading `?`, so we should strip it with `slice`.
|
||||
{ body: { queryString: request.url.search.slice(1), acs: this._getACS() } }
|
||||
{ body: { queryString: request.url.search ? request.url.search.slice(1) : '', acs: this._getACS() } }
|
||||
];
|
||||
} else {
|
||||
this._options.log(['debug', 'security', 'saml'], 'Logout has been initiated by the user.');
|
||||
|
|
Loading…
Reference in a new issue