@@ -44,7 +44,7 @@ const wallets = [
4444
4545export function LoginAndOnboardingPage ( props : {
4646 account : Account | undefined ;
47- nextPath : string | undefined ;
47+ redirectPath : string ;
4848} ) {
4949 return (
5050 < div className = "relative flex min-h-screen flex-col overflow-hidden bg-background" >
@@ -81,7 +81,10 @@ export function LoginAndOnboardingPage(props: {
8181
8282 < main className = "container z-10 flex grow flex-col items-center justify-center gap-6 py-12" >
8383 < ClientOnly ssr = { < LoadingCard /> } >
84- < PageContent nextPath = { props . nextPath } account = { props . account } />
84+ < PageContent
85+ redirectPath = { props . redirectPath }
86+ account = { props . account }
87+ />
8588 </ ClientOnly >
8689 </ main >
8790
@@ -110,7 +113,7 @@ function LoadingCard() {
110113}
111114
112115function PageContent ( props : {
113- nextPath : string | undefined ;
116+ redirectPath : string ;
114117 account : Account | undefined ;
115118} ) {
116119 const [ screen , setScreen ] = useState <
@@ -133,11 +136,7 @@ function PageContent(props: {
133136
134137 function onComplete ( ) {
135138 setScreen ( { id : "complete" } ) ;
136- if ( props . nextPath && isValidRedirectPath ( props . nextPath ) ) {
137- router . replace ( props . nextPath ) ;
138- } else {
139- router . replace ( "/team" ) ;
140- }
139+ router . replace ( props . redirectPath ) ;
141140 }
142141
143142 if ( connectionStatus === "connecting" ) {
@@ -154,7 +153,7 @@ function PageContent(props: {
154153 < LazyOnboardingUI
155154 account = { screen . account }
156155 onComplete = { onComplete }
157- redirectPath = { props . nextPath || "/team" }
156+ redirectPath = { props . redirectPath }
158157 />
159158 </ Suspense >
160159 ) ;
@@ -220,19 +219,6 @@ function CustomConnectEmbed(props: {
220219 ) ;
221220}
222221
223- function isValidRedirectPath ( encodedPath : string ) : boolean {
224- try {
225- // Decode the URI component
226- const decodedPath = decodeURIComponent ( encodedPath ) ;
227- // ensure the path always starts with a _single_ slash
228- // double slash could be interpreted as `//example.com` which is not allowed
229- return decodedPath . startsWith ( "/" ) && ! decodedPath . startsWith ( "//" ) ;
230- } catch {
231- // If decoding fails, return false
232- return false ;
233- }
234- }
235-
236222type AuroraProps = {
237223 size : { width : string ; height : string } ;
238224 pos : { top : string ; left : string } ;
0 commit comments