mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 00:06:16 +08:00
redirecting back to test page when auth is undefined
This commit is contained in:
parent
e45cb9cc5e
commit
3d868b68a1
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue