File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
apps/site/src/app/(main)/guest-login Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ async function GuestLogin({
77 searchParams,
88} : {
99 searchParams ?: {
10+ email ?: string ;
1011 return_to ?: string ;
1112 } ;
1213} ) {
@@ -20,7 +21,10 @@ async function GuestLogin({
2021 < h1 className = "font-display text-3xl md:text-5xl mb-20" >
2122 Enter Passphrase
2223 </ h1 >
23- < GuestLoginVerificationForm />
24+ < GuestLoginVerificationForm
25+ email = { searchParams ?. email }
26+ return_to = { searchParams ?. return_to }
27+ />
2428 </ div >
2529 ) ;
2630}
Original file line number Diff line number Diff line change 1- "use client" ;
2-
3- import { useSearchParams } from "next/navigation" ;
41import clsx from "clsx" ;
52
63import ValidatingForm from "@/lib/components/ValidatingForm/ValidatingForm" ;
@@ -11,17 +8,19 @@ import styles from "@/lib/components/ValidatingForm/ValidatingForm.module.scss";
118const VERIFICATION_PATH = "/api/guest/verify" ;
129const PASSPHRASE_REGEX = / \w + - \w + - \w + - \w + / ;
1310
14- export default function GuestLoginVerificationForm ( ) {
15- const searchParams = useSearchParams ( ) ;
16- const email = searchParams . get ( "email" ) ;
17- const return_to = searchParams . get ( "return_to" ) ;
18-
11+ export default function GuestLoginVerificationForm ( {
12+ email,
13+ return_to,
14+ } : {
15+ email ?: string ;
16+ return_to ?: string ;
17+ } ) {
1918 if ( ! email ) {
2019 return < p > Error: email was not provided</ p > ;
2120 }
2221
2322 const newSearchParams = new URLSearchParams ( ) ;
24- if ( return_to !== null ) {
23+ if ( return_to ) {
2524 newSearchParams . append ( "return_to" , return_to ) ;
2625 }
2726
You can’t perform that action at this time.
0 commit comments