2025-02-07 14:54:10 +01:00
|
|
|
import { Controller, Get, Req, UseGuards } from '@nestjs/common';
|
|
|
|
import { JwtAuthGuard } from '../../common/modules/auth/guards/jwt-auth.guard';
|
|
|
|
import { UserEntity } from '../../common/modules/auth/models/entities/user.entity';
|
|
|
|
import { ApiBearerAuth } from '@nestjs/swagger';
|
2025-02-07 12:47:58 +01:00
|
|
|
|
2025-02-07 14:54:10 +01:00
|
|
|
@Controller('users')
|
|
|
|
export class UsersController {
|
|
|
|
constructor() {}
|
2025-02-07 12:47:58 +01:00
|
|
|
|
2025-02-07 14:54:10 +01:00
|
|
|
@Get('me')
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
|
|
@ApiBearerAuth()
|
|
|
|
getMyself(@Req() req: any): UserEntity {
|
|
|
|
return req.user;
|
|
|
|
}
|
2025-02-07 12:47:58 +01:00
|
|
|
}
|