[Desktop][Bug fix]: Stop target sessions before unauthenticating user session (#2891)

* add stopAll invocation to ipc handler

* trigger modal on both signout btns

* refactor invalidateSession fn

* fix application controller tests

* fix failing tests settings-card/user

* add test to Acceptance | authentication

* migrate electron dialog.showMessageBoxSync to Hds

* rename channel and tracked prop, consolidate cancel fns

* combine modals, add willDestroy, refactor

* test signout and close sessions modal

* address feedback

* refactor window.electron in authentication-test

* address feedback

* refactor: 💡 Fix failing tests

---------

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
LaurenandZhihe Li authored and GitHub committed 2025-08-04 16:44:27 -04:00
1 parent f776ba0617
commit 990e2d6b9d
20 files changed
+342 -84

No files matched your search

@@ -25,6 +25,10 @@ module('Integration | Component | settings-card/user', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'en-us');
hooks.beforeEach(function () {
this.set('application', { showModalOrLogout: () => {} });
});
test('it renders password correctly', async function (assert) {
this.owner.register(
'service:session',
@@ -34,7 +38,9 @@ module('Integration | Component | settings-card/user', function (hooks) {
},
);
await render(hbs`<SettingsCard::User />`);
await render(
hbs`<SettingsCard::User @onSignout={{this.application.showModalOrLogout}} />`,
);
assert.dom(AUTHENTICATION_BADGE).hasText('Authenticated');
assert.dom(AUTH_METHOD_TYPE).hasText('Password');
@@ -52,7 +58,9 @@ module('Integration | Component | settings-card/user', function (hooks) {
},
);
await render(hbs`<SettingsCard::User />`);
await render(
hbs`<SettingsCard::User @onSignout={{this.application.showModalOrLogout}} />`,
);
assert.dom(AUTHENTICATION_BADGE).hasText('Authenticated');
assert.dom(AUTH_METHOD_TYPE).hasText('OIDC');
@@ -70,7 +78,9 @@ module('Integration | Component | settings-card/user', function (hooks) {
},
);
await render(hbs`<SettingsCard::User />`);
await render(
hbs`<SettingsCard::User @onSignout={{this.application.showModalOrLogout}} />`,
);
assert.dom(AUTHENTICATION_BADGE).hasText('Authenticated');
assert.dom(AUTH_METHOD_TYPE).hasText('LDAP');