import { Injectable } from '@nestjs/common' ; import { ConfigService } from '@nestjs/config' ; import { PassportStrategy } from '@nestjs/passport' ; import { ExtractJwt , Strategy } from 'passport-jwt' ; import { JwtPayload } from '../types' ; @ Injectable ( ) export class AtStrategy extends PassportStrategy ( Strategy , 'jwt' ) { constructor ( config ) { super ( { jwtFromRequest : ExtractJwt . fromAuthHeaderAsBearerToken ( ) , secretOrKey : config . get < string > ( 'AT_SECRET' ) , } ) ; } validate ( payload ) { return payload ; } }