Skip to content

Commit

Permalink
feat(reader-activation): handle global auth success in registration b…
Browse files Browse the repository at this point in the history
…lock
  • Loading branch information
adekbadek committed Sep 2, 2022
1 parent 977e77a commit debf5d2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions assets/blocks/reader-registration/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ function domReady( callback ) {
'.newspack-registration__registration-success'
);

readerActivation.on( 'reader', ( { detail: { authenticated } } ) => {
if ( authenticated ) {
form.style.display = 'none';
}
} );

form.startLoginFlow = () => {
messageElement.classList.add( 'newspack-registration--hidden' );
messageElement.innerHTML = '';
Expand Down Expand Up @@ -139,6 +133,12 @@ function domReady( callback ) {
} );
} );
} );

readerActivation.on( 'reader', ( { detail: { authenticated } } ) => {
if ( authenticated ) {
form.endLoginFlow( null, 200 );
}
} );
} );
} );
} )( window.newspackReaderActivation );

0 comments on commit debf5d2

Please sign in to comment.