mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
fixed architecture to dispatch events when routes and token changes
This commit is contained in:
18
src/pages/logout-page/LogoutPageElement.ts
Normal file
18
src/pages/logout-page/LogoutPageElement.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { controller } from "@github/catalyst";
|
||||
import { closest, update } from "core/utils";
|
||||
import { AuthService } from "services/";
|
||||
import { AppMainElement } from "components/";
|
||||
|
||||
@controller
|
||||
class LogoutPageElement extends HTMLElement {
|
||||
@closest appMain: AppMainElement;
|
||||
authService: AuthService;
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
connectedCallback() {
|
||||
this.authService = new AuthService(this.appMain.appService);
|
||||
this.appMain?.authStore?.userLogout();
|
||||
this.appMain?.routerService.goTo("/login");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user