add: Abstract class to simplifie the code,
AbstractRedirectView, AbstractAuthentificateView AbstractUnAuthentificateView
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import AbstractView from "../AbstractView.js";
|
||||
import { client, navigateTo } from "../../index.js";
|
||||
import AbstractUnAuthentificateView from "../AbstractUnAuthentificateView.js";
|
||||
|
||||
async function register()
|
||||
{
|
||||
@ -22,9 +22,9 @@ async function register()
|
||||
});
|
||||
}
|
||||
|
||||
export default class extends AbstractView {
|
||||
export default class extends AbstractUnAuthentificateView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
super(params, "/home");
|
||||
}
|
||||
|
||||
async postInit()
|
||||
@ -34,11 +34,6 @@ export default class extends AbstractView {
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
if (await client.isAuthentificate())
|
||||
{
|
||||
navigateTo("/home")
|
||||
return;
|
||||
}
|
||||
return `
|
||||
<div class=form>
|
||||
<label>Register</label>
|
||||
|
Reference in New Issue
Block a user