Add frontend handling for users without a company

Make setSelectedCompany null-safe and clear stale localStorage.
Conditionally initialize company store state in bootstrap. Add
router guard to redirect no-company users to NoCompanyView while
allowing super admins through. Hide sidebar when no company.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Darko Gjorgjijoski
2026-04-04 00:36:00 +02:00
parent fae59221d3
commit c3a59a46db
5 changed files with 46 additions and 15 deletions

View File

@@ -147,12 +147,6 @@ export default [
component: RegisterWithInvitation,
meta: { requiresAuth: false },
},
{
path: '/admin/no-company',
name: 'no.company',
component: NoCompanyView,
meta: { requiresAuth: true },
},
{
path: '/installation',
component: LayoutInstallation,
@@ -203,6 +197,11 @@ export default [
component: LayoutBasic,
meta: { requiresAuth: true },
children: [
{
path: 'no-company',
name: 'no.company',
component: NoCompanyView,
},
{
path: 'dashboard',
name: 'dashboard',