clean up validation, still not happy

This commit is contained in:
rubikscraft
2022-04-02 23:25:49 +02:00
parent 805ff8ab0e
commit bcd427f5a7
43 changed files with 307 additions and 277 deletions

View File

@@ -41,6 +41,10 @@ export class MainAuthGuard extends AuthGuard(['jwt', 'guest']) {
const user = await this.validateUser(
context.switchToHttp().getRequest().user,
);
if (!user.id) {
this.logger.error('User has no id, this should not happen');
throw new InternalServerErrorException();
}
// These are the permissions required to access the route
const permissions = this.extractPermissions(context);