additional param checks (#16910)

This commit is contained in:
claire bontempo 2022-08-26 11:44:01 -07:00 committed by GitHub
parent 6ac085dc57
commit 298d5aa08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -14,7 +14,10 @@ export default Route.extend({
}
path = window.decodeURIComponent(path);
const source = 'oidc-callback'; // required by event listener in auth-jwt component
let queryParams = { source, namespace, path, code, state };
let queryParams = { source, path: path || '', code: code || '', state: state || '' };
if (namespace) {
queryParams.namespace = namespace;
}
window.opener.postMessage(queryParams, window.origin);
},
setupController(controller) {

View File

@ -152,11 +152,11 @@ module('Unit | Route | vault/cluster/oidc-callback', function (hooks) {
assert.propContains(
this.windowStub.lastCall.args[0],
{
code: undefined,
code: '',
path: 'oidc',
state: undefined,
state: '',
},
'model hook returns non-existent state param'
'model hook returns empty string when state param nonexistent'
);
});