File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ interface Props {
1717 onSubmit : ( data : LoginSchema ) => void ;
1818 loading ?: boolean ;
1919 formId ?: string ;
20+ params ?: string ;
2021}
2122
2223export const LoginForm = ( props : Props ) => {
@@ -71,6 +72,12 @@ export const LoginForm = (props: Props) => {
7172 </ FormControl >
7273 < a
7374 href = "/forgot-password"
75+ onClick = { ( e ) => {
76+ e . preventDefault ( ) ;
77+ window . location . replace (
78+ `/forgot-password${ props . params ? `${ props . params } ` : "" } ` ,
79+ ) ;
80+ } }
7481 className = "text-muted-foreground hover:text-muted-foreground/80 text-sm absolute right-0 bottom-[2.565rem]" // 2.565 is *just* perfect
7582 >
7683 { t ( "forgotPasswordTitle" ) }
Original file line number Diff line number Diff line change 7979 "profileScopeName" : " Profile" ,
8080 "profileScopeDescription" : " Allows the app to access your profile information." ,
8181 "groupsScopeName" : " Groups" ,
82- "groupsScopeDescription" : " Allows the app to access your group information."
82+ "groupsScopeDescription" : " Allows the app to access your group information." ,
83+ "backToLoginButton" : " Back to login"
8384}
Original file line number Diff line number Diff line change 7979 "profileScopeName" : " Profile" ,
8080 "profileScopeDescription" : " Allows the app to access your profile information." ,
8181 "groupsScopeName" : " Groups" ,
82- "groupsScopeDescription" : " Allows the app to access your group information."
82+ "groupsScopeDescription" : " Allows the app to access your group information." ,
83+ "backToLoginButton" : " Back to login"
8384}
Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ import { Button } from "@/components/ui/button";
1010import { useAppContext } from "@/context/app-context" ;
1111import { useTranslation } from "react-i18next" ;
1212import Markdown from "react-markdown" ;
13- import { useNavigate } from "react-router" ;
13+ import { useLocation } from "react-router" ;
1414
1515export const ForgotPasswordPage = ( ) => {
1616 const { forgotPasswordMessage } = useAppContext ( ) ;
1717 const { t } = useTranslation ( ) ;
18- const navigate = useNavigate ( ) ;
18+ const { search } = useLocation ( ) ;
19+ const searchParams = new URLSearchParams ( search ) ;
1920
2021 return (
2122 < Card >
@@ -36,10 +37,13 @@ export const ForgotPasswordPage = () => {
3637 className = "w-full"
3738 variant = "outline"
3839 onClick = { ( ) => {
39- navigate ( "/login" ) ;
40+ const eparams = searchParams . toString ( ) ;
41+ window . location . replace (
42+ `/login${ eparams . length > 0 ? `?${ eparams } ` : "" } ` ,
43+ ) ;
4044 } }
4145 >
42- { t ( "notFoundButton " ) }
46+ { t ( "backToLoginButton " ) }
4347 </ Button >
4448 </ CardFooter >
4549 </ Card >
Original file line number Diff line number Diff line change @@ -264,6 +264,10 @@ export const LoginPage = () => {
264264 onSubmit = { ( values ) => loginMutate ( values ) }
265265 loading = { loginIsPending || oauthIsPending }
266266 formId = { formId }
267+ params = { ( ( ) => {
268+ const eparams = searchParams . toString ( ) ;
269+ return eparams . length > 0 ? `?${ eparams } ` : "" ;
270+ } ) ( ) }
267271 />
268272 ) }
269273 { providers . length == 0 && (
You can’t perform that action at this time.
0 commit comments