add: Abstract class to simplifie the code,

AbstractRedirectView,
AbstractAuthentificateView
AbstractUnAuthentificateView
This commit is contained in:
2023-11-29 19:55:44 +01:00
parent a6666b889f
commit 84a5a592ca
8 changed files with 67 additions and 28 deletions

View File

@ -9,6 +9,8 @@ import RegisterView from "./views/accounts/RegisterView.js";
import LogoutView from "./views/accounts/LogoutView.js";
import { Client } from "./api/client.js";
import AbstractProtectedView from "./views/AbstractRedirectView.js";
import AbstractRedirectView from "./views/AbstractRedirectView.js";
let client = new Client(location.protocol + "//" + location.host)
@ -64,6 +66,10 @@ const router = async (uri = "") => {
await lastView.leavePage();
const view = new match.route.view(getParams(match));
if (view instanceof AbstractRedirectView && await view.redirect())
return 1;
lastView = view;
let content = await view.getHtml();