trypost/app
Falconiere Barbosa 410eb9612e fix(linkedin): drop deprecated r_basicprofile from default scopes
Make r_basicprofile opt-in via LINKEDIN_EXTRA_SCOPES so self-hosted users
unblock by default and ops with legacy/enterprise products keep working.

Why
---
LinkedIn rejects OAuth authorize requests with a generic "Bummer,
something went wrong" page when an app asks for a scope it can't grant.
`r_basicprofile` is a legacy scope deprecated in 2018; new LinkedIn dev
apps don't have it, so every self-hosted user hits the rejection
immediately on `/connect/linkedin`.

The two products LinkedIn actually grants to standard apps today are:

- Sign In with LinkedIn using OpenID Connect → `openid profile email`
- Share on LinkedIn                          → `w_member_social`

That set is enough for the connect flow. The only piece of data
`r_basicprofile` was buying us is `/v2/me`'s `vanityName` (pretty
`linkedin.com/in/<slug>`). `fetchVanityName()` already handles HTTP
failure gracefully (returns null), and the only downstream consumer —
`LinkedInPagePublisher`'s post-URL builder — already falls back to a
numeric `linkedin.com/feed/update/<id>` URL when `$account->username`
is null.

Backward compatibility
----------------------
Ops with legacy or enterprise LinkedIn products approved on their dev
app (so they DO have `r_basicprofile`) can opt back in via env:

    LINKEDIN_EXTRA_SCOPES=r_basicprofile

`LinkedInController::resolveScopes()` merges this comma-separated list
into the default scope array. The connect flow's `Socialite::scopes()`
call then includes the legacy scope, preserving the pre-PR behaviour
end-to-end (including `vanityName` lookup).

Net effect for users without `r_basicprofile`:
- Connect flow works (was previously rejected by LinkedIn).
- Posts publish exactly the same way.
- Generated post URLs use the numeric form instead of the vanity slug.

Tests
-----
- `linkedin connect requests the default scope set when LINKEDIN_EXTRA_SCOPES is unset`
- `linkedin connect appends LINKEDIN_EXTRA_SCOPES to the default scope set`
- Existing `splits comma-separated approvedScopes` fixture updated to
  match the new default set.
2026-06-10 13:51:07 -03:00
..
Actions Merge branch 'main' into feat/ai-image-regenerate 2026-05-21 20:16:16 -03:00
Ai/Agents feat(posts): introduce change_mode for flexible image and text regeneration 2026-05-21 20:00:41 -03:00
Broadcasting feat: regenerate AI post images with brand palette in editor 2026-05-21 16:27:55 -03:00
Concerns refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
Console/Commands fix(social): proactive token refresh actually refreshes (not just verifies) 2026-05-12 19:36:35 -03:00
DataTransferObjects feat: AI image generation pipeline and post creation overhaul 2026-05-08 13:38:30 -03:00
Enums Stop persisting instagram_carousel as a content type 2026-06-04 18:10:39 -03:00
Events feat: regenerate AI post images with brand palette in editor 2026-05-21 16:27:55 -03:00
Exceptions refactor(social): TokenRedactor::redact accepts nullable 2026-05-19 09:25:01 -03:00
Features feat: transition AI usage from feature-based limits to a centralized monthly credit system with token tracking. 2026-05-03 19:36:26 -03:00
Helpers fix: correct Upload.php filename case for Linux CI 2026-03-31 12:01:48 -03:00
Http fix(linkedin): drop deprecated r_basicprofile from default scopes 2026-06-10 13:51:07 -03:00
Jobs Stop persisting instagram_carousel as a content type 2026-06-04 18:10:39 -03:00
Listeners fix(posthog): harden usage sync after deletes and workspace removal 2026-05-19 19:01:53 -03:00
Mail feat: @mentions in comments, AI Action layer + MCP tools, settings tabs 2026-05-01 20:59:03 -03:00
Mcp refactor(posts): replace PostStatusGuard with PostStatusRules for editing and deletion checks 2026-05-21 19:32:42 -03:00
Models feat(billing): make trial card requirement configurable 2026-05-21 10:02:38 -03:00
Observers feat(posthog): keep social_accounts_count and posts_count fresh on account group 2026-05-15 18:40:07 -03:00
Policies refactor: move workspace tenancy check on Post into PostPolicy 2026-05-04 13:20:52 -03:00
Providers chore: remove unused Gemini provider extension and debug middleware 2026-05-11 21:24:11 -03:00
Rules refactor(posts): tighten content-length caps and simplify contentOverflow 2026-05-11 20:06:44 -03:00
Services fix(tiktok): default disable_comment to true when meta omits allow_comments 2026-05-29 10:30:06 -03:00
Socialite refactor: centralize social API base URLs into the configuration file to improve maintainability and environment flexibility 2026-05-02 13:49:20 -03:00
Support refactor(posts): replace PostStatusGuard with PostStatusRules for editing and deletion checks 2026-05-21 19:32:42 -03:00