accounts: merge register and login #1

This commit is contained in:
2024-02-13 10:09:16 +01:00
parent 5da7602dbb
commit 6765e1bb30
4 changed files with 165 additions and 159 deletions

View File

@ -1,10 +1,8 @@
import { Client } from "./api/client.js";
import LoginView from "./views/accounts/LoginView.js";
import Dashboard from "./views/Dashboard.js";
import Search from "./views/Search.js";
import HomeView from "./views/HomeView.js";
import RegisterView from "./views/accounts/RegisterView.js";
import LogoutView from "./views/accounts/LogoutView.js";
import GameOfflineView from "./views/GameOfflineView.js";
import GameView from "./views/GameView.js";
@ -18,6 +16,7 @@ import MatchMakingView from "./views/MatchMakingView.js";
import TournamentPageView from "./views/tournament/TournamentPageView.js";
import TournamentsView from "./views/tournament/TournamentsListView.js";
import TournamentCreateView from "./views/tournament/TournamentCreateView.js";
import AuthentificateView from "./views/accounts/AuthentifyView.js";
let client = new Client(location.origin);
let lang = client.lang;
@ -62,7 +61,6 @@ async function renderView(view)
let error_code = await view.postInit();
if (error_code === 404)
renderView(new PageNotFoundView());
else if (error_code === 403)
@ -77,9 +75,9 @@ const router = async(uri) => {
{ path: "/tournaments/create", view: TournamentCreateView },
{ path: "/tournaments/:id", view: TournamentPageView },
{ path: "/tournaments/", view: TournamentsView },
{ path: "/login", view: LoginView },
{ path: "/login", view: AuthentificateView },
{ path: "/register", view: AuthentificateView },
{ path: "/logout", view: LogoutView },
{ path: "/register", view: RegisterView },
{ path: "/search", view: Search },
{ path: "/home", view: HomeView },
{ path: "/settings", view: SettingsView },