Skip to content

Commit 847ce61

Browse files
fix: autologin navigate (#18)
* fix: autologin navigation
1 parent 7f87862 commit 847ce61

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/router.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
UnionedIncomingMessages,
88
VALID_INCOMING_EVENTS,
99
} from "./messaging/incoming";
10-
import { info, warn } from "./utils/logging";
10+
import { warn } from "./utils/logging";
1111
import { autoLogin } from "./utils/login";
1212
import { sendMessageToTestBox } from "./messaging";
1313
import { INITIALIZE_ACK, LOGIN_ACK, NAVIGATE_ACK } from "./messaging/outgoing";
@@ -42,10 +42,14 @@ export function routeMessage(
4242
case LOGIN:
4343
loggingIn = true;
4444
sendMessageToTestBox(LOGIN_ACK);
45-
autoLogin(data, router).then((nextUrl: string) => {
45+
autoLogin(data, router).then((nextUrl: string | boolean) => {
4646
loggingIn = false;
4747
const goTo = navigateUrl || nextUrl;
48-
if (goTo && goTo !== window.location.href) {
48+
if (
49+
goTo &&
50+
typeof goTo == "string" &&
51+
goTo !== window.location.href
52+
) {
4953
const func = router["navigate"];
5054
if (func) {
5155
func({ url: goTo });

0 commit comments

Comments
 (0)