Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move auth routes to /dashboard #2157

Merged
merged 5 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/api/src/controllers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ app.patch("/:id/email", authorizer({}), async (req, res) => {
buttonText: "Verify Email",
buttonUrl: frontendUrl(
req,
`/verify-new-email?${qs.stringify({
`/dashboard/verify-new-email?${qs.stringify({
emailValidToken,
email: lowerCaseEmail,
})}`
Expand Down Expand Up @@ -979,7 +979,11 @@ async function sendVerificationEmail(req: Request, user: User, selectedPlan) {
buttonText: "Verify Email",
buttonUrl: frontendUrl(
req,
`/verify?${qs.stringify({ email, emailValidToken, selectedPlan })}`
`/dashboard/verify?${qs.stringify({
email,
emailValidToken,
selectedPlan,
})}`
),
unsubscribe: unsubscribeUrl(req),
text: [
Expand Down Expand Up @@ -1068,7 +1072,7 @@ app.post(
buttonText: "Reset Password",
buttonUrl: frontendUrl(
req,
`/reset-password?${qs.stringify({ email, resetToken })}`
`/dashboard/reset-password?${qs.stringify({ email, resetToken })}`
),
unsubscribe: unsubscribeUrl(req),
text: [
Expand Down
2 changes: 1 addition & 1 deletion packages/www/components/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const Login = ({ id, buttonText, onSubmit, loading, errors }) => {
transform: "translateY(-50%)",
top: "50%",
}}>
<Link href="/forgot-password" passHref legacyBehavior>
<Link href="/dashboard/forgot-password" passHref legacyBehavior>
<A
variant="primary"
css={{
Expand Down
25 changes: 25 additions & 0 deletions packages/www/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,31 @@ let config = {
destination: "https://livepeer.canny.io",
permanent: false,
},
{
source: "/register",
destination: "/dashboard/register",
permanent: false,
},
{
source: "/login",
destination: "/dashboard/login",
permanent: false,
},
{
source: "/reset-password",
destination: "/dashboard/reset-password",
permanent: false,
},
{
source: "/verify",
destination: "/dashboard/verify",
permanent: false,
},
{
source: "/verify-new-email",
destination: "/dashboard/verify-new-email",
permanent: false,
},
];
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Layout from "layouts/main";
import { withRecaptcha } from "layouts/withRecaptcha";
import Login from "../components/Login";
import Register from "../components/Register";
import Login from "../../components/Login";
import Register from "../../components/Register";
import {
Flex,
Box,
Expand All @@ -15,7 +15,7 @@ import { useRouter } from "next/router";
import { useGoogleReCaptcha } from "react-google-recaptcha-v3";
import { Register as Content } from "content";
import Link from "next/link";
import { useApi, useLoggedIn } from "../hooks";
import { useApi, useLoggedIn } from "../../hooks";
import { useJune, events } from "hooks/use-june";

const emailVerificationMode =
Expand Down Expand Up @@ -49,7 +49,7 @@ const RegisterPage = () => {
useEffect(() => {
if (user) {
if (emailVerificationMode && user.emailValid === false) {
router.replace("/verify");
router.replace("/dashboard/verify");
} else {
router.replace("/dashboard");
}
Expand Down
Loading
Loading