import { Controller, Get, Request, UseGuards } from '@nestjs/common'; import { AppService } from './app.service'; import { AuthService } from './auth/auth.service'; import { JwtAuthGuard } from './jwt-auth/jwt-auth.guard'; @Controller() export class AppController { constructor( private readonly appService: AppService, private authService: AuthService, ) {} @UseGuards(JwtAuthGuard) @Get() getHello(@Request() req): string { return req.user; } }