Skip to content

Commit b100acb

Browse files
authored
Fix broken route to login (#2643)
* Fix broken route to login * Fix broken route to login
1 parent f22c038 commit b100acb

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

client/src/Routes.jsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function AppRoutes() {
5959
const pathname = location.pathname;
6060
const hasUserFeedbackSuveyFeatureFlag = useFeatureFlag("userFeedbackSurvey");
6161
const isAdminRoute = pathname.startsWith("/admin");
62-
const isWidgetRoute = pathname === "/widget";
62+
const isWidgetRoute = pathname.startsWith("/widget");
6363
const isUserFacingRoute = !isAdminRoute && !isWidgetRoute;
6464

6565
const showSurveySnackbar =
@@ -108,13 +108,10 @@ export default function AppRoutes() {
108108
<Route path="profile/:id" element={<Profile />} />
109109
<Route path="register" element={<Register />} />
110110
<Route path="confirm/:token" element={<ConfirmEmail />} />
111-
<Route path="login{/:email}" element={<Login />} />
111+
<Route path="login/:email?" element={<Login />} />
112+
<Route path="forgotpassword/:email?" element={<ForgotPassword />} />
112113
<Route
113-
path="forgotpassword{/:email}"
114-
element={<ForgotPassword />}
115-
/>
116-
<Route
117-
path="resetpasswordemailsent{/:email}"
114+
path="resetpasswordemailsent/:email?"
118115
element={<ResetPasswordEmailSent />}
119116
/>
120117
<Route path="resetPassword/:token" element={<ResetPassword />} />

server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ app.use(express.static("public"));
6969
// page, so requests that don't match any of the above are
7070
// assumed to be for react pages.
7171
if (process.env.NODE_ENV === "production") {
72-
app.get("/*splat", (req, res) => {
72+
app.get("*splat", (req, res) => {
7373
res.sendFile(path.join(__dirname + "/client/build/index.html"));
7474
});
7575
}

0 commit comments

Comments
 (0)