diff --git a/app/stores/AuthStore.ts b/app/stores/AuthStore.ts index 8cc3e3e9b..3f745098d 100644 --- a/app/stores/AuthStore.ts +++ b/app/stores/AuthStore.ts @@ -10,6 +10,7 @@ import Team from "~/models/Team"; import User from "~/models/User"; import env from "~/env"; import { client } from "~/utils/ApiClient"; +import Desktop from "~/utils/Desktop"; import Storage from "~/utils/Storage"; const AUTH_STORE = "AUTH_STORE"; @@ -325,5 +326,8 @@ export default class AuthStore { this.team = null; this.policies = []; this.token = null; + + // Tell the host application we logged out, if any – allows window cleanup. + Desktop.bridge?.onLogout?.(); }; } diff --git a/app/typings/window.d.ts b/app/typings/window.d.ts index e8dd0a084..8442161ca 100644 --- a/app/typings/window.d.ts +++ b/app/typings/window.d.ts @@ -31,6 +31,11 @@ declare global { */ onTitlebarDoubleClick: () => Promise; + /** + * Passes log out events from the app to the main process + */ + onLogout: () => Promise; + /** * Adds a custom host to config */