v0.1.73 — /:company Route Should Redirect Authenticated Users
v0.1.73 — /:company Route Redirect Behaviour
Status: Spec Drift Identified — This release flags a deviation from the intended routing behaviour for the
/:companyentry point. A fix is in progress.
What Should Happen
The /:company route is the branded entry point for each agency's portal. Its intended behaviour is:
- Verify the company identifier from the URL
- Apply the agency's theme (colours, logo, branding)
- If the user is unauthenticated → show the login screen
- If the user is authenticated → redirect to
/:company/accounts/
This logic is defined in CompanySpecificHomeView and ensures that returning logged-in users land directly in their accounts list without any extra navigation.
What Is Currently Happening
As of v0.1.73, the /:company route renders a welcome dashboard with quick-access cards for authenticated users instead of redirecting them to /:company/accounts/.
| Scenario | Expected | Actual |
|---|---|---|
Unauthenticated user visits /{company} | Login screen shown | ✅ Correct (handled by company layout) |
Authenticated user visits /{company} | Redirect to /{company}/accounts/ | ❌ Welcome dashboard rendered |
Why This Matters
- Authenticated users see an unintended dashboard instead of their accounts list, breaking the expected post-login flow.
- The extra page adds unnecessary friction — users must navigate an additional step to reach their account information.
- The behaviour diverges from the
CompanySpecificHomeViewcontract that other parts of the application depend on.
Planned Fix
Add an authenticated redirect inside the /:company page component so that any logged-in user is immediately sent to /:company/accounts/. The unauthenticated case (redirect to /sign-in) is already handled correctly by the company layout and does not need to change.
// Intended routing logic for /:company
if (!authenticated) {
// Company layout already handles → /sign-in
} else {
// Redirect → /:company/accounts/
}