mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-12 14:55:39 +01:00
clean up validation, still not happy
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user