AuthGuard, PassportStrategy handshaking

오픈소스·2023년 10월 17일
0
import { AuthGuard } from '@nestjs/passport';

class JwtGuard extends AuthGuard('jwt') {
  
  async canActivate(context: ExecutionContext) {

    super.canActivate(context);

  }
  
  handleRequest(err, user, info) {
    
  }
}
import { PassportStrategy } from '@nestjs/passport';
import { ExtractJwt, Strategy } from 'passport-jwt';

class JwtStrategy extends PassportStrategy(Strategy) {
  constructor() {
    super({
      jwtFromRequest: ,
      ignoreExpiration: ,
      secretOrKey: 
    });
  }
  
  async validate(payload: AccountJwtPayloadType) {
    
  }
}

0개의 댓글