import { Injectable } from '@nestjs/common' ; import { PassportSerializer } from '@nestjs/passport' ; import type { Payload } from './auth.interface' ; @ Injectable ( ) export class AuthSerializer extends PassportSerializer { public serializeUser ( user , done ) { done ( null , user ) ; } public deserializeUser ( data , done ) { try { done ( null , data ) ; } catch ( err ) { done ( < Error > err ) ; } } }