NestJS - Authentication
Consider this NestJS controller method using sessions:
What will be the response if a user with
@Get('dashboard')
getDashboard(@Session() session: Record) {
if (session.isAuthenticated) {
return `Welcome back, ${session.username}`;
}
return 'Access denied';
} What will be the response if a user with
session.isAuthenticated = true and session.username = 'Alice' accesses /dashboard?