NestJS - Authentication
You want to protect a NestJS route so only logged-in users with a session can access it. Which approach correctly checks the session and denies access if no user is logged in?
import { Controller, Get, Req, Res } from '@nestjs/common';
import { Response, Request } from 'express';
@Controller()
export class AppController {
@Get('dashboard')
dashboard(@Req() req: Request, @Res() res: Response) {
// What should go here?
}
}