-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE] 7.03 매수 API 구현 #49 #70
Conversation
@@ -13,6 +13,7 @@ export function setupSwagger(app: INestApplication): void { | |||
.setTitle('Juga API') | |||
.setDescription('Juga API 문서입니다.') | |||
.setVersion('1.0.0') | |||
.addBearerAuth() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 처음으로 토큰이 필요한 무언가가 나왔네요.. 고생하셨습니다!!
created_at: Date; | ||
|
||
@Column({ nullable: true }) | ||
completed_at?: Date; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 타입스크립트에서는 nullable한 값은 옵셔널로 두는게 관례인가요? 신기하네요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오늘도 수고하셨습니다!
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class JwtAuthGuard extends AuthGuard('jwt') {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 오우 JwtAuthGuard를 클래스로 만들어서 사용할 수 있었네요 ..? 저는 AuthGuard('strategy 이름') 이런 식으로 사용해봤는데 가독성이나 이후 검증 로직을 추가하거나 하는데 좋을것 같네요 canActivate 함수에 원하는 로직을 넣거나 해서요
✅ 주요 작업
💭 고민과 해결과정
@UseGuards
데코레이터를 이용해서 user 정보를 가져올 수 있었다. request.user.id로 사용자의 아이디를 조회하도록 구현했다.