trypost/app/Http/Middleware/App
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
..
EnsureAccountReady.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
EnsureHasWorkspace.php refactor(auth): split workspace gate into EnsureHasWorkspace middleware 2026-06-25 14:30:15 -03:00
EnsureRegistrationEnabled.php feat(auth): self-hosted registration gate + admin seeder (closes #46) 2026-05-19 11:45:16 -03:00
HandleInertiaRequests.php feat: per-workspace pricing, onboarding, and billing overhaul 2026-06-21 20:40:03 -03:00
SetLocale.php refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale 2026-03-30 11:53:42 -03:00