feat: preserve login params in forgot password screen (#819)

This commit is contained in:
Stavros
2026-04-26 18:03:25 +03:00
committed by GitHub
parent ab7c81f63b
commit c364b8682c
5 changed files with 23 additions and 6 deletions
+8 -4
View File
@@ -10,12 +10,13 @@ import { Button } from "@/components/ui/button";
import { useAppContext } from "@/context/app-context";
import { useTranslation } from "react-i18next";
import Markdown from "react-markdown";
import { useNavigate } from "react-router";
import { useLocation } from "react-router";
export const ForgotPasswordPage = () => {
const { forgotPasswordMessage } = useAppContext();
const { t } = useTranslation();
const navigate = useNavigate();
const { search } = useLocation();
const searchParams = new URLSearchParams(search);
return (
<Card>
@@ -36,10 +37,13 @@ export const ForgotPasswordPage = () => {
className="w-full"
variant="outline"
onClick={() => {
navigate("/login");
const eparams = searchParams.toString();
window.location.replace(
`/login${eparams.length > 0 ? `?${eparams}` : ""}`,
);
}}
>
{t("notFoundButton")}
{t("backToLoginButton")}
</Button>
</CardFooter>
</Card>
+4
View File
@@ -264,6 +264,10 @@ export const LoginPage = () => {
onSubmit={(values) => loginMutate(values)}
loading={loginIsPending || oauthIsPending}
formId={formId}
params={(() => {
const eparams = searchParams.toString();
return eparams.length > 0 ? `?${eparams}` : "";
})()}
/>
)}
{providers.length == 0 && (