Re-open Meta's page selection on every connect with auth_type=rerequest - #314
Open
gynsus wants to merge 1 commit into
Open
Re-open Meta's page selection on every connect with auth_type=rerequest#314gynsus wants to merge 1 commit into
gynsus wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The trap
Create a new Facebook Page, hit "Connect Facebook" — and TryPost silently connects the old Page again. No page picker, no way to reach the new Page from inside the app.
Meta's OAuth dialog reuses the previous grant, including its page selection: once the app has been authorized for one Page, subsequent logins skip the consent screen entirely and
/me/accountskeeps returning only the originally ticked Pages. Disconnecting in TryPost doesn't help, because the grant lives on Meta's side. The only escape is manual surgery in facebook.com → Settings → Business Integrations, which users find only after filing a support ticket (ours did).The fix
Pass
auth_type=rerequeston the OAuth redirect for both Meta flows (Facebook and Instagram-via-Facebook). Meta then re-opens the consent dialog on every connect, with the "Edit settings" page selection available, so adding a newly created Page is just: connect again → tick the Page.The cost is one extra consent screen for users reconnecting an unchanged setup — which is also the screen that tells them what they previously granted, so it's arguably a feature.
Testing
FacebookControllerTest/InstagramFacebookControllerTestpass, with the connect-redirect mock asserting the new parameter. Verified live: withrerequestin place, a freshly created Page shows up in the page selection dialog on the very next connect.