Fix Dashboard 404, missing Invoices table, and account limits
This commit is contained in:
@@ -109,6 +109,16 @@ export class AuthService {
|
||||
throw new UnauthorizedException('Invalid credentials');
|
||||
}
|
||||
|
||||
// ── Self-Healing: Upgrade old trial accounts to unlimited companies ──
|
||||
try {
|
||||
await this.dataSource.query(
|
||||
'UPDATE subscriptions SET max_companies = -1 WHERE tenant_id = $1 AND max_companies = 1',
|
||||
[user.tenant_id],
|
||||
);
|
||||
} catch (e) {
|
||||
console.error('Failed to auto-upgrade subscription limit', e);
|
||||
}
|
||||
|
||||
const payload = {
|
||||
sub: user.id,
|
||||
tenantId: user.tenant_id,
|
||||
|
||||
Reference in New Issue
Block a user