File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ export function Verifying() {
3232 onSuccess : async ( ) => {
3333 clearOtpSession ( )
3434 goToStep ( 'authenticated' )
35+ // Navigate the address bar off the magic-link landing URL so a
36+ // refresh doesn't re-trigger verification.
37+ if ( typeof window !== 'undefined' ) {
38+ window . history . replaceState ( { } , '' , '/' )
39+ }
3540 config ?. onSuccess ?.( )
3641 } ,
3742 onError : ( err ) => {
Original file line number Diff line number Diff line change @@ -292,9 +292,10 @@ describe('connector', () => {
292292 // Disconnect
293293 await connector . disconnect ?.( )
294294
295- // Auth should be reset and reinitialized
295+ // Auth should be reset and reinitialized, then surface the sign-up
296+ // page so the user can re-authenticate.
296297 expect ( store . getState ( ) . auth . email ) . toBeNull ( )
297- expect ( store . getState ( ) . auth . step ) . toBe ( 'initializing ' )
298+ expect ( store . getState ( ) . auth . step ) . toBe ( 'sign-up ' )
298299 expect ( store . getState ( ) . auth . config ) . toEqual ( authConfig )
299300 } )
300301
Original file line number Diff line number Diff line change @@ -85,10 +85,13 @@ export function zeroDevWallet(
8585
8686 async disconnect ( ) {
8787 await connector . disconnect ?.( )
88- // Reset auth state on disconnect
88+ // Reset auth state on disconnect and surface the sign-up page so the
89+ // user can immediately re-authenticate instead of seeing an empty
90+ // AuthFlow (the 'initializing' step renders null).
8991 if ( params . config ?. auth ) {
9092 store . getState ( ) . auth . reset ( )
9193 store . getState ( ) . auth . initialize ( params . config . auth )
94+ store . getState ( ) . auth . goToStep ( 'sign-up' )
9295 }
9396 } ,
9497
You can’t perform that action at this time.
0 commit comments