ft_transcendence/frontend/static/js/views/HomeView.js
2023-11-29 16:05:49 +01:00

21 lines
488 B
JavaScript

import AbstractView from "./AbstractView.js";
import { client, navigateTo } from "../index.js";
export default class extends AbstractView {
constructor(params) {
super(params);
this.setTitle("Home");
}
async getHtml() {
if (await client.isAuthentificate() === false)
{
navigateTo("/login");
return;
}
return `
<h1>HOME</h1>
<a href="/logout" class="nav__link" data-link>Logout</a>
`;
}
}