trypost/tests/Feature/Social
Paulo Castellano 074a66f1e2 fix(linkedin-page): persist OAuth scopes through the page-picker flow
The LinkedIn Page connection has a two-step OAuth: first the
`callback` stashes the Socialite user in `linkedin_page_pending` and
redirects to the page picker, then `select` finalizes by writing the
chosen organization to social_accounts. The pending payload was missing
`approved_scopes`, and both finalize paths (`update` for reconnect,
`updateOrCreate` for first connect) never wrote the `scopes` column.

Result: every LinkedIn Page account had `scopes = NULL` in the DB,
the publish-time scope check saw `w_organization_social` as missing
and blocked every post with 'Missing permissions. Please reconnect
your account.'

Fix: stash `approved_scopes` in the session payload, then in both
finalize paths persist it with the same comma-split treatment used by
the LinkedIn personal controller (the LinkedIn-OpenID provider has the
same separator quirk — granted scopes come CSV-joined inside a
single Socialite array element).

Test: `linkedin page select splits comma-separated approvedScopes
before saving` covers the persist + split path.
2026-05-14 11:48:30 -03:00
..
BlueskyControllerTest.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00
FacebookControllerTest.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00
InstagramControllerTest.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00
LinkedInControllerTest.php fix(linkedin,pinterest): split CSV/space-joined OAuth scopes before saving 2026-05-14 10:55:53 -03:00
LinkedInPageControllerTest.php fix(linkedin-page): persist OAuth scopes through the page-picker flow 2026-05-14 11:48:30 -03:00
MastodonControllerTest.php refactor: implement lazy token refreshing and persist Mastodon scopes 2026-05-03 21:58:25 -03:00
PinterestControllerTest.php fix(linkedin,pinterest): split CSV/space-joined OAuth scopes before saving 2026-05-14 10:55:53 -03:00
ThreadsControllerTest.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00
TikTokControllerTest.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00
XControllerTest.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00
YouTubeControllerTest.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00