ft_transcendence/frontend/static/js/views/AbstractAuthentificateView.js

19 lines
375 B
JavaScript
Raw Normal View History

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