public-jwt.strategy.ts
480 Bytes
import { ExtractJwt, Strategy } from 'passport-jwt';
import { PassportStrategy } from '@nestjs/passport';
import { Injectable } from '@nestjs/common';
@Injectable()
export class PulbicJwtStrategy extends PassportStrategy(Strategy, 'public') {
constructor() {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
secretorkley: 'dito-hash-public',
});
}
async validate() {
return { type: 'public' };
}
}