File tree Expand file tree Collapse file tree 6 files changed +15
-14
lines changed
lib/components/forms/shared Expand file tree Collapse file tree 6 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export const revalidate = 60;
66export default async function Hacker ( {
77 searchParams,
88} : {
9- searchParams ? : {
9+ searchParams : {
1010 prefaceAccepted ?: string ;
1111 } ;
1212} ) {
Original file line number Diff line number Diff line change @@ -6,25 +6,24 @@ import getUserIdentity from "@/lib/utils/getUserIdentity";
66async function GuestLogin ( {
77 searchParams,
88} : {
9- searchParams ? : {
9+ searchParams : {
1010 email ?: string ;
1111 return_to ?: string ;
1212 } ;
1313} ) {
14+ const { email, return_to } = searchParams ;
15+
1416 const identity = await getUserIdentity ( ) ;
1517 if ( identity . uid !== null ) {
16- redirect ( searchParams ?. return_to ?? "/portal" ) ;
18+ redirect ( return_to ?? "/portal" ) ;
1719 }
1820
1921 return (
2022 < div className = "min-h-screen flex flex-col items-center justify-center" >
2123 < h1 className = "font-display text-3xl md:text-5xl mb-20" >
2224 Enter Passphrase
2325 </ h1 >
24- < GuestLoginVerificationForm
25- email = { searchParams ?. email }
26- return_to = { searchParams ?. return_to }
27- />
26+ < GuestLoginVerificationForm email = { email } return_to = { return_to } />
2827 </ div >
2928 ) ;
3029}
Original file line number Diff line number Diff line change @@ -5,21 +5,23 @@ import LoginForm from "./components/LoginForm";
55async function Login ( {
66 searchParams,
77} : {
8- searchParams ? : {
8+ searchParams : {
99 return_to ?: string ;
1010 } ;
1111} ) {
12+ const { return_to } = searchParams ;
13+
1214 const identity = await getUserIdentity ( ) ;
1315 if ( identity . uid !== null ) {
14- redirect ( searchParams ?. return_to ?? "/portal" ) ;
16+ redirect ( return_to ?? "/portal" ) ;
1517 }
1618
1719 return (
1820 < div className = "min-h-screen flex flex-col items-center justify-center" >
1921 < h1 className = "font-display text-3xl md:text-5xl mb-20" >
2022 Login to Portal
2123 </ h1 >
22- < LoginForm return_to = { searchParams ?. return_to } />
24+ < LoginForm return_to = { return_to } />
2325 </ div >
2426 ) ;
2527}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export const revalidate = 60;
66export default async function Mentor ( {
77 searchParams,
88} : {
9- searchParams ? : {
9+ searchParams : {
1010 prefaceAccepted ?: string ;
1111 } ;
1212} ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export const revalidate = 60;
66export default async function Volunteer ( {
77 searchParams,
88} : {
9- searchParams ? : {
9+ searchParams : {
1010 prefaceAccepted ?: string ;
1111 } ;
1212} ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import getUserIdentity from "@/lib/utils/getUserIdentity";
1212export const revalidate = 60 ;
1313
1414interface ApplicationFlowProps {
15- searchParams ? : {
15+ searchParams : {
1616 prefaceAccepted ?: string ;
1717 } ;
1818 applicationType : "Hacker" | "Mentor" | "Volunteer" ;
@@ -25,7 +25,7 @@ export default async function ApplicationFlow({
2525 applicationURL,
2626 children,
2727} : ApplicationFlowProps & PropsWithChildren ) {
28- const hasAcceptedQueryParam = searchParams ? .prefaceAccepted === "true" ;
28+ const hasAcceptedQueryParam = searchParams . prefaceAccepted === "true" ;
2929 const identity = await getUserIdentity ( ) ;
3030
3131 if ( identity . status !== null ) {
You can’t perform that action at this time.
0 commit comments