fix: store tenant slug (not UUID) in current_tenant; remove plan trial periods
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1e4aab378d
commit
149939f5f0
|
|
@ -34,10 +34,12 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
|
|||
const isPlatformAdmin = Array.isArray(user.roles) &&
|
||||
(user.roles.includes('platform_admin') || user.roles.includes('platform_super_admin'));
|
||||
if (!isPlatformAdmin) {
|
||||
apiClient<{ id: string; name: string; plan: string }>('/api/v1/auth/my-org')
|
||||
apiClient<{ id: string; slug: string; name: string; plan: string }>('/api/v1/auth/my-org')
|
||||
.then((org) => {
|
||||
setCurrentTenant({ id: org.id, name: org.name, plan: org.plan as any });
|
||||
localStorage.setItem('current_tenant', JSON.stringify({ id: org.id, name: org.name, plan: org.plan }));
|
||||
// Use slug as the tenant identifier (X-Tenant-Id header must be the slug, not UUID)
|
||||
const tenantId = org.slug || org.id;
|
||||
setCurrentTenant({ id: tenantId, name: org.name, plan: org.plan as any });
|
||||
localStorage.setItem('current_tenant', JSON.stringify({ id: tenantId, name: org.name, plan: org.plan }));
|
||||
})
|
||||
.catch(() => { /* ignore — token may be expired */ });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const SEED_PLANS = [
|
|||
maxUsers: 20,
|
||||
maxStandingOrders: 100,
|
||||
hardLimitPercent: 150,
|
||||
trialDays: 14,
|
||||
trialDays: 0,
|
||||
isActive: true,
|
||||
},
|
||||
{
|
||||
|
|
@ -44,7 +44,7 @@ const SEED_PLANS = [
|
|||
maxUsers: -1,
|
||||
maxStandingOrders: -1,
|
||||
hardLimitPercent: 0, // no hard limit
|
||||
trialDays: 14,
|
||||
trialDays: 0,
|
||||
isActive: true,
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue