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

@ -1,5 +1,5 @@
import AbstractView from "../AbstractView.js";
import { client, navigateTo } from "../../index.js";
import AbstractUnAuthentificateView from "../AbstractUnAuthentificateView.js";
async function login()
{
@ -27,9 +27,9 @@ async function login()
});
}
export default class extends AbstractView {
export default class extends AbstractUnAuthentificateView {
constructor(params) {
super(params);
super(params, "/home");
}
async postInit()
@ -39,11 +39,6 @@ export default class extends AbstractView {
}
async getHtml() {
if (await client.isAuthentificate())
{
navigateTo("/home")
return;
}
return `
<div class=form>
<label>Login</label>