Spaces:
Sleeping
Sleeping
File size: 590 Bytes
6f49b87 9a951d7 6f49b87 9a951d7 6f49b87 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import { Controller, Get, UseGuards, Req } from '@nestjs/common';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
import { AuthenticatedRequest } from '../../common/interfaces/authenticated-request.interface';
import { ApiBearerAuth, ApiTags, ApiExcludeController } from '@nestjs/swagger';
@ApiExcludeController()
@ApiTags('Profile')
@ApiBearerAuth()
@Controller('profile')
export class ProfileController {
@Get()
@UseGuards(JwtAuthGuard)
getProfile(@Req() req: AuthenticatedRequest) {
return {
message: 'Protected route success',
user: req.user,
};
}
}
|