import { Strategy } from 'passport-jwt' ; import { PassportStrategy } from '@nestjs/passport' ; import { Injectable } from '@nestjs/common' ; import { ConfigService } from '@nestjs/config' ; import { Request } from 'express' ; @ Injectable ( ) export class JwtStrategy extends PassportStrategy ( Strategy ) { constructor ( configService ) { super ( { jwtFromRequest : ( req ) => req . cookies [ 'auth_token' ] , ignoreExpiration : false , secretOrKey : configService . get ( 'JWT_SECRET' ) , } ) ; } validate ( payload ) { return { ... payload } ; } }