diff --git a/frontend/src/pages/invite/join.ts b/frontend/src/pages/invite/join.ts
index e12511de..c254162a 100644
--- a/frontend/src/pages/invite/join.ts
+++ b/frontend/src/pages/invite/join.ts
@@ -6,7 +6,6 @@ import { renderInviteMessage } from "./ui/inviteMessage";
import type { SignUpSuccessDetail } from "@/features/accounts/sign-up-form";
import type { OrgUpdatedDetail } from "@/pages/invite/ui/org-form";
-import { ROUTES } from "@/routes";
import type { UserOrg, UserOrgInviteInfo } from "@/types/user";
import AuthService, { type LoggedInEventDetail } from "@/utils/AuthService";
import LiteElement, { html } from "@/utils/LiteElement";
@@ -97,7 +96,7 @@ export class Join extends LiteElement {
html`
${err instanceof Error ? err.message : err}
@@ -174,7 +173,7 @@ export class Join extends LiteElement {
if (inviteInfo?.orgSlug) {
this.navTo(`/orgs/${inviteInfo.orgSlug}`);
} else {
- this.navTo(ROUTES.home);
+ this.navTo(this.orgBasePath);
}
}
}
diff --git a/frontend/src/pages/log-in.ts b/frontend/src/pages/log-in.ts
index 1e8011e0..8602ac02 100644
--- a/frontend/src/pages/log-in.ts
+++ b/frontend/src/pages/log-in.ts
@@ -4,7 +4,6 @@ import { assign, createMachine, interpret } from "@xstate/fsm";
import { type PropertyValues } from "lit";
import { customElement, property, state } from "lit/decorators.js";
-import { ROUTES } from "@/routes";
import { isApiError } from "@/utils/api";
import type { ViewState } from "@/utils/APIRouter";
import AuthService from "@/utils/AuthService";
@@ -145,7 +144,7 @@ export class LogInPage extends LiteElement {
viewState!: ViewState;
@property({ type: String })
- redirectUrl: string = ROUTES.home;
+ redirectUrl?: string;
private readonly formStateService = interpret(machine);
diff --git a/frontend/src/utils/APIRouter.ts b/frontend/src/utils/APIRouter.ts
index b49e5a57..24828650 100644
--- a/frontend/src/utils/APIRouter.ts
+++ b/frontend/src/utils/APIRouter.ts
@@ -5,7 +5,7 @@ type Routes = { [key: string]: UrlPattern };
type Paths = { [key: string]: string };
export type ViewState = {
- // route name, e.g. "home"
+ // route name, e.g. "admin"
route: string | null;
// path name
// e.g. "/dashboard"
diff --git a/frontend/src/utils/AuthService.ts b/frontend/src/utils/AuthService.ts
index 2c14ad57..28465c4d 100644
--- a/frontend/src/utils/AuthService.ts
+++ b/frontend/src/utils/AuthService.ts
@@ -347,7 +347,7 @@ export default class AuthService {
this.logout();
const { pathname, search, hash } = window.location;
const redirectUrl =
- pathname !== ROUTES.login && pathname !== ROUTES.home
+ pathname !== ROUTES.login && pathname !== "/"
? `${pathname}${search}${hash}`
: "";
window.dispatchEvent(AuthService.createNeedLoginEvent({ redirectUrl }));