ft_transcendence/frontend/static/js/views/AbstractAuthentifiedView.js

19 lines
389 B
JavaScript
Raw Permalink Normal View History

import { client, navigateTo } from "../index.js";
import AbstractRedirectView from "./AbstractRedirectView.js";
export default class extends AbstractRedirectView{
2023-11-30 07:05:46 -05:00
constructor(params, title) {
super(params, title, "/login");
}
async redirect()
{
if (await client.isAuthentificate() === false)
{
navigateTo(this.redirect_url);
return 1;
}
return 0;
}
}