zhuyeel

[nest.js] jwt를 이용해서 request 에 사용자 정보 넣기

회원기반 사이트는 반드시 인증이 필요하다. 웹개발에서 jwt라는 쉬운 방법이 있는데 nest.js에서도 지원이 된다. local에서는 jwt로 발급된 token을 bearer token 이나 cookie를 이용하여 테스트 할 수 있다. cookie를 이용한 방법을 소개한다. a. strategy 인증을 담당하는 module에 import할 strategy 클래스 작성 validate에서 return되는 객체는 request 에 담겨진다. import { Injectable, NotFoundException, UnauthorizedException
2 min read

[nest.js] Custom Repository

nest.js typeorm 0.2.x 까지는 @EntityRepository 데코레이터를 사용해서 쉽게 주입이 가능해 졌으나 0.3.x 로 올라가면서 deprecated 되었다. 아무래도 deprecated 된 건 꺼림칙하다. custom repository를 포기하는건 거의 실무에선 불가에 가까운데 다행히도 기존처럼 사용 가능하다. 본인도 nest.js를 한지 한달도 안된 상태라 깊게는 모르므로 간략히 이해가는 선에서 정리한다.
3 min read

Subscribe to X세대 신입사원

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe
774-86-01972 cinnabar.3d@gmail.com