Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class AuthController {
summary: '프로필 조회(Protected)',
description: '로그인이 필요한 프로필 조회 API',
})
@ApiBearerAuth() // Swagger에서 Bearer Token 헤더를 입력할 수 있도록 표시
@ApiBearerAuth('access-token') // Swagger에서 Bearer Token 헤더를 입력할 수 있도록 표시
@ApiResponse({
status: 200,
description: '정상적으로 접근한 경우',
Expand Down
5 changes: 5 additions & 0 deletions src/gameRoom/gameRoom.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
ApiResponse,
ApiBody,
ApiParam,
ApiBearerAuth,
} from '@nestjs/swagger';

// DTO import
Expand Down Expand Up @@ -63,6 +64,7 @@ export class GameRoomController {
@UseGuards(RedisAuthGuard) // 컨트롤러 전체에 Guard 적용
@Post('create')
@ApiOperation({ summary: '방 생성과 동시에 참가' })
@ApiBearerAuth('access-token') // Swagger에서 Bearer Token 헤더를 입력할 수 있도록 표시
@ApiBody({ type: CreateGameRoomDto })
@ApiResponse({
status: 201,
Expand Down Expand Up @@ -92,6 +94,7 @@ export class GameRoomController {
@UseGuards(RedisAuthGuard) // 컨트롤러 전체에 Guard 적용
@Post('join/:roomId')
@ApiOperation({ summary: '방 참가' })
@ApiBearerAuth('access-token') // Swagger에서 Bearer Token 헤더를 입력할 수 있도록 표시
@ApiParam({ name: 'roomId', type: Number, description: '참가할 게임 방 ID' })
@ApiResponse({
status: 201,
Expand Down Expand Up @@ -135,6 +138,7 @@ export class GameRoomController {
@UseGuards(RedisAuthGuard) // 컨트롤러 전체에 Guard 적용
@Delete('leave/:roomId')
@ApiOperation({ summary: '방 나가기' })
@ApiBearerAuth('access-token') // Swagger에서 Bearer Token 헤더를 입력할 수 있도록 표시
@ApiParam({ name: 'roomId', type: Number, description: '나갈 게임 방 ID' })
@ApiResponse({
status: 200,
Expand Down Expand Up @@ -179,6 +183,7 @@ export class GameRoomController {

@Get(':roomId')
@ApiOperation({ summary: '방 상태 조회' })
@ApiBearerAuth('access-token') // Swagger에서 Bearer Token 헤더를 입력할 수 있도록 표시
@ApiParam({ name: 'roomId', type: Number, description: '조회할 게임 방 ID' })
@ApiResponse({
status: 200,
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function bootstrap() {
origin: [
'http://localhost:5173',
'http://localhost:3000',
'https://api.davincicodegame.store',
'https://davincicodegame.store',
],
credentials: true,
});
Expand All @@ -32,6 +32,7 @@ async function bootstrap() {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
in: 'header',
},
'access-token',
)
Expand Down
Loading