jwt middleware1 [User] Authentication #3 JWT Middleware 사용자에게 전달된 token의 정보를 어떻게 받을 수 있을까? JWT middleware 작성 / 적용 // jwt.middleware.ts @Injectable() export class JwtMiddleware implements NestMiddleware {} // 미들웨어에 추가 // #1 app.module.ts export class AppModule implements NestModule { configure(consumer: MiddlewareConsumer) { consumer .apply(JwtMiddleware) .forRoutes({ path: '/graphql', method: RequestMethod.ALL }); } } path: '*' 전체 route에 적용할 수도 있고, m.. 2023. 4. 8. 이전 1 다음 728x90