Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

276 B
Raw Blame
import { Injectable } from '@nestjs/common'
import { AuthGuard } from '@nestjs/passport'

@Injectable()
export class OptionalJwtAccessTokenGuard extends AuthGuard('jwt-access-token') {
  handleRequest(err: any, user: any) {
    return !err && user ? user : { id: null }
  }
}