2025-02-07 20:24:16 +01:00
|
|
|
import { Controller, Get, UseGuards } from '@nestjs/common';
|
2025-02-07 14:54:10 +01:00
|
|
|
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 20:24:16 +01:00
|
|
|
import { User } from 'src/common/modules/auth/decorators/user.decorator';
|
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()
|
2025-02-07 20:24:16 +01:00
|
|
|
getMyself(@User() user: UserEntity): UserEntity {
|
|
|
|
return user;
|
2025-02-07 14:54:10 +01:00
|
|
|
}
|
2025-02-07 12:47:58 +01:00
|
|
|
}
|