redirecting back to test page when auth is undefined

This commit is contained in:
Miodec 2022-09-28 16:11:36 +02:00
parent e45cb9cc5e
commit 3d868b68a1

View file

@ -11,6 +11,7 @@ import * as Leaderboards from "../elements/leaderboards";
import * as TestUI from "../test/test-ui";
import * as PageTransition from "../states/page-transition";
import * as NavigateEvent from "../observables/navigate-event";
import { Auth } from "../firebase";
//source: https://www.youtube.com/watch?v=OstALBk-jTc
// https://www.youtube.com/watch?v=OstALBk-jTc
@ -83,12 +84,20 @@ const routes: Route[] = [
{
path: "/login",
load: (): void => {
if (!Auth) {
nav("/");
return;
}
PageController.change(PageLogin.page);
},
},
{
path: "/account",
load: (_params, options): void => {
if (!Auth) {
nav("/");
return;
}
PageController.change(PageAccount.page, {
data: options.data,
});