@@ -91,7 +91,12 @@ export const useSignUpContext = (): SignUpContextType => {
91
91
displayConfig : displayConfig ,
92
92
} ) ;
93
93
94
- let signUpUrl = pickRedirectionProp ( 'signUpUrl' , { ctx, options, displayConfig } , false ) ;
94
+ // The `ctx` object here refers to the SignUp component's props.
95
+ // SignUp's own options won't have a `signUpUrl` property, so we have to get the value
96
+ // from the `path` prop instead, when the routing is set to 'path'.
97
+ let signUpUrl =
98
+ ( ctx . routing === 'path' ? ctx . path : undefined ) ||
99
+ pickRedirectionProp ( 'signUpUrl' , { options, displayConfig } , false ) ;
95
100
if ( authQs && ctx . routing !== 'virtual' ) {
96
101
signUpUrl += `#/?${ authQs } ` ;
97
102
}
@@ -175,7 +180,12 @@ export const useSignInContext = (): SignInContextType => {
175
180
signUpUrl += `#/?${ authQs } ` ;
176
181
}
177
182
178
- let signInUrl = pickRedirectionProp ( 'signInUrl' , { ctx, options, displayConfig } , false ) ;
183
+ // The `ctx` object here refers to the SignIn component's props.
184
+ // SignIn's own options won't have a `signInUrl` property, so we have to get the value
185
+ // from the `path` prop instead, when the routing is set to 'path'.
186
+ let signInUrl =
187
+ ( ctx . routing === 'path' ? ctx . path : undefined ) ||
188
+ pickRedirectionProp ( 'signInUrl' , { options, displayConfig } , false ) ;
179
189
if ( authQs && ctx . routing !== 'virtual' ) {
180
190
signInUrl += `#/?${ authQs } ` ;
181
191
}
0 commit comments