Creating a CRM Super Admin

This commit is contained in:
2026-09-19 21:54:21 +03:30
parent ff5ad21eb9
commit b016b4754f
28 changed files with 2977 additions and 6 deletions
+6 -1
View File
@@ -24,7 +24,11 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
}
async validate(payload: JwtPayload & { typ?: string; mobile?: string }) {
if (payload.typ === 'portal' || payload.typ === 'org-select') {
if (
payload.typ === 'portal' ||
payload.typ === 'org-select' ||
payload.typ === 'platform-admin'
) {
throw new UnauthorizedException();
}
if (!payload.sub || !payload.organizationId) {
@@ -42,6 +46,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
userId: user.id,
organizationId: payload.organizationId,
isActive: true,
organization: { isActive: true },
},
select: { organizationId: true, role: true },
});