NestJS - Authentication
Identify the error in this guard code snippet:
import { CanActivate, ExecutionContext } from '@nestjs/common';
export class MyGuard implements CanActivate {
canActivate(context: ExecutionContext) {
if (context.switchToHttp().getRequest().user) {
return true;
}
}
}