apps/api/src/auth/session.serializer.ts
PassportSerializer
Methods |
deserializeUser | |||||||||
deserializeUser(payload, done: (err: Error | null,undefined) => void)
|
|||||||||
Defined in apps/api/src/auth/session.serializer.ts:14
|
|||||||||
Parameters :
Returns :
void
|
serializeUser | |||||||||
serializeUser(user: UserEntity, done: (err: Error | null,id: UserEntity) => void)
|
|||||||||
Defined in apps/api/src/auth/session.serializer.ts:7
|
|||||||||
Parameters :
Returns :
void
|
import { Injectable } from '@nestjs/common'
import { PassportSerializer } from '@nestjs/passport'
import { UserEntity } from '../entities/user.entity'
@Injectable()
export class SessionSerializer extends PassportSerializer {
serializeUser(
user: UserEntity,
done: (err: Error | null, id?: UserEntity) => void
): void {
done(null, user)
}
deserializeUser(
payload: unknown,
done: (err: Error | null, payload?: unknown) => void
): void {
done(null, payload)
}
}