ft_transcendence/frontend/static/js/views/AbstractUnAuthentificateView.js
starnakin 84a5a592ca add: Abstract class to simplifie the code,
AbstractRedirectView,
AbstractAuthentificateView
AbstractUnAuthentificateView
2023-11-29 19:55:44 +01:00

17 lines
366 B
JavaScript

import { client, navigateTo } from "../index.js";
import AbstractRedirectView from "./AbstractRedirectView.js";
export default class extends AbstractRedirectView{
constructor(params, url) {
super(params, url);
}
async redirect()
{
if (await client.isAuthentificate() === false)
return 0;
navigateTo(this.redirect_url);
return 1;
}
}