feat: fix auth:

This commit is contained in:
Nevo David 2024-06-04 01:17:35 +07:00
parent 73b5368707
commit b4963a519e
2 changed files with 7 additions and 1 deletions

View File

@ -70,6 +70,12 @@ export class AuthMiddleware implements NestMiddleware {
const setOrg =
organization.find((org) => org.id === orgHeader) || organization[0];
if (!organization) {
removeAuth(res);
res.status(401).send('Unauthorized');
return ;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
req.user = user;

File diff suppressed because one or more lines are too long