trypost/app/Http/Controllers/Auth
Paulo Castellano dba6346226 refactor(auth): split workspace gate into EnsureHasWorkspace middleware
EnsureAccountReady bundled a subscription gate (redirects to onboarding,
SaaS only) with a workspace gate (redirects to workspace creation). The
connect routes can't sit behind it because connecting/disconnecting
happens during onboarding, before a subscription exists.

Split the workspace gate into a standalone EnsureHasWorkspace middleware:

- EnsureAccountReady is now subscription-only.
- EnsureHasWorkspace redirects to workspace creation when there is no
  current workspace, in both SaaS and self-hosted modes.
- The social connect group gains EnsureHasWorkspace; the main app group
  gains it alongside EnsureAccountReady (listed after it, so the
  subscription gate still runs first — no custom middleware priority).
- The repeated `if (! $workspace) redirect()` guard is removed from the
  connect/store/authorize/disconnect/index/toggle handlers, and their
  return types are tightened (no more dangling RedirectResponse).

LinkedIn connect's no-workspace path changes from a popup callback to the
same redirect as the other platforms.
2026-06-25 14:30:15 -03:00
..
Concerns feat: capture signup UTMs/IP and add GitHub OAuth login 2026-05-04 18:42:25 -03:00
AcceptInviteController.php fix(members): preserve invited role on accept and surface viewer in role menu 2026-06-22 14:24:19 -03:00
AuthenticatedSessionController.php fix: security audit - IDOR, open redirect, authorization, session fixes 2026-03-30 14:58:25 -03:00
BlueskyController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
DiscordController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
EmailVerificationNotificationController.php refactor: restructure to Actions, subdomain routes (app/api), API tokens 2026-03-29 19:24:28 -03:00
EmailVerificationPromptController.php refactor: restructure to Actions, subdomain routes (app/api), API tokens 2026-03-29 19:24:28 -03:00
FacebookController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
GitHubController.php revert: keep one OAuth callback URL per provider 2026-05-04 19:42:13 -03:00
GoogleController.php revert: keep one OAuth callback URL per provider 2026-05-04 19:42:13 -03:00
InstagramController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
InstagramFacebookController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
LinkedInController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
MastodonController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
NewPasswordController.php feat: improvements on invites 2026-01-20 16:53:54 -03:00
PasswordResetLinkController.php feat: improvements on invites 2026-01-20 16:53:54 -03:00
PinterestController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
RegisteredUserController.php chore: remove unused Pennant package and dead user-timezone handling 2026-06-22 13:37:38 -03:00
SignupSuccessController.php chore: tracking, gtm and more 2026-03-30 21:32:43 -03:00
SocialController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
TelegramController.php feat: per-workspace pricing, onboarding, and billing overhaul 2026-06-21 20:40:03 -03:00
ThreadsController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
TikTokController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
VerifyEmailController.php refactor: restructure to Actions, subdomain routes (app/api), API tokens 2026-03-29 19:24:28 -03:00
XController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
YouTubeController.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00