additional param checks (#16910)
This commit is contained in:
parent
6ac085dc57
commit
298d5aa08f
|
@ -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) {
|
||||
|
|
|
@ -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'
|
||||
);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue