open-vault/ui/app/routes/vault/cluster/oidc-callback.js
Jordan Reimer a3862bcf97
OIDC Auth Bug (#13133)
* fixes issue with oidc auth method when MetaMask chrome extenstion is used

* adds changelog entry

* updates auth-jwt integration tests

* fixes race condition in runCommands ui-panel helper method where running multiple commands would not always result in the same output order
2021-11-15 08:48:11 -07:00

23 lines
747 B
JavaScript

import Route from '@ember/routing/route';
export default Route.extend({
templateName: 'vault/cluster/oidc-callback',
model() {
// left blank so we render the template immediately
},
afterModel() {
let { auth_path: path, code, state } = this.paramsFor(this.routeName);
let { namespaceQueryParam: namespace } = this.paramsFor('vault.cluster');
path = window.decodeURIComponent(path);
const source = 'oidc-callback'; // required by event listener in auth-jwt component
let queryParams = { source, namespace, path, code, state };
window.opener.postMessage(queryParams, window.origin);
},
renderTemplate() {
this.render(this.templateName, {
into: 'application',
outlet: 'main',
});
},
});