-
Notifications
You must be signed in to change notification settings - Fork 794
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
Instagram Gallery Block: Stop automatically connecting blocks without access token #15792
Conversation
4768ce3
to
8198364
Compare
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: June 2, 2020. |
8198364
to
5821494
Compare
@scruffian apologize for having moved this back to WIP without notice! In 8058f64 I've actually removed the auto-connect flow, which was kinda the whole point of the PR. I've only kept the "auto-disconnection", which is used when the user disconnects a block, to automatically disconnect all other blocks using the same token. |
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.
LGTM and works as advertised
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.
This works well in my tests.
r207600-wpcom |
Changes proposed in this Pull Request:
Previously
On mount, IG blocks automatically attempted to connect to Instagram.
If they had a token stored, they validated it and, if valid, used it.
If they didn't have a token, they fetched it and, if existing, used it
This had the intended side effect of automatically connecting new blocks inserted by users with valid tokens.
But it also had the unintended side effect of... automatically connecting blocks inserted by other users and left "empty" (not connected, without access token) in a post.
Now...
On mount, IG blocks only automatically attempt to connect to Instagram if they have a token stored.
They will validate it and, if valid, use the token.
"Empty" blocks don't automatically connect anymore.
Instead, they will show the normal "Connect to Instagram" button.
But before sending the user over to Instagram to authorize the connection, we first check if they have a valid token.
If they do, the block will then, finally, automatically use the token, and the user won't be sent to Instagram anymore.
If they don't, they'll proceed to Instagram to create a new token as usual.
Testing instructions:
Proposed changelog entry for your changes: