Add onLogout method to desktop bridge
This commit is contained in:
@@ -10,6 +10,7 @@ import Team from "~/models/Team";
|
|||||||
import User from "~/models/User";
|
import User from "~/models/User";
|
||||||
import env from "~/env";
|
import env from "~/env";
|
||||||
import { client } from "~/utils/ApiClient";
|
import { client } from "~/utils/ApiClient";
|
||||||
|
import Desktop from "~/utils/Desktop";
|
||||||
import Storage from "~/utils/Storage";
|
import Storage from "~/utils/Storage";
|
||||||
|
|
||||||
const AUTH_STORE = "AUTH_STORE";
|
const AUTH_STORE = "AUTH_STORE";
|
||||||
@@ -325,5 +326,8 @@ export default class AuthStore {
|
|||||||
this.team = null;
|
this.team = null;
|
||||||
this.policies = [];
|
this.policies = [];
|
||||||
this.token = null;
|
this.token = null;
|
||||||
|
|
||||||
|
// Tell the host application we logged out, if any – allows window cleanup.
|
||||||
|
Desktop.bridge?.onLogout?.();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
5
app/typings/window.d.ts
vendored
5
app/typings/window.d.ts
vendored
@@ -31,6 +31,11 @@ declare global {
|
|||||||
*/
|
*/
|
||||||
onTitlebarDoubleClick: () => Promise<void>;
|
onTitlebarDoubleClick: () => Promise<void>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Passes log out events from the app to the main process
|
||||||
|
*/
|
||||||
|
onLogout: () => Promise<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a custom host to config
|
* Adds a custom host to config
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user