-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugins): add url redirect for wc subscription renewals #3525
base: trunk
Are you sure you want to change the base?
Conversation
1bd87d5
to
3492424
Compare
3492424
to
f70d25b
Compare
@@ -113,7 +113,9 @@ window.newspackRAS.push( function ( readerActivation ) { | |||
/** If there's a pre-auth, signing in redirects to the reader account. */ | |||
if ( reader?.email && ! reader?.authenticated ) { | |||
link.setAttribute( 'data-redirect', link.getAttribute( 'href' ) ); | |||
redirectInput.value = link.getAttribute( 'href' ); | |||
if ( ! redirectInput?.value ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should respect any pre-defined redirect values.
@@ -177,7 +179,7 @@ window.newspackRAS.push( function ( readerActivation ) { | |||
emailInput.value = reader?.email || ''; | |||
} | |||
|
|||
if ( redirectInput && ev?.target?.getAttribute( 'data-redirect' ) ) { | |||
if ( ev?.target?.getAttribute( 'data-redirect' ) && ! redirectInput?.value ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here re: respecting pre-defined redirect values
Got some feedback here so removing the |
f70d25b
to
e29b3a3
Compare
e29b3a3
to
eabb518
Compare
Added some changes to make the redirect happen via a new my-account endpoint Just awaiting feedback to verify the expected behavior before marking this one ready for review. |
All Submissions:
Changes proposed in this Pull Request:
Closes https://app.asana.com/0/1206274567818686/1208437232706180/f
This PR adds handling for
aa newnp_renewal
parammy-account/my-renewals
endpoint to redirect readers to the first available pending renewal checkout, otherwise the subscriptions my account page:How to test the changes in this Pull Request:
my-account/my-renewals
endpoint of your test site:site.url/my-account/my-renewals
Other information: