You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Injectable } from '@nestjs/common'
|
|
|
|
import { PassportSerializer } from '@nestjs/passport'
|
|
|
|
import { type Profile } from 'passport-42'
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class SessionSerializer extends PassportSerializer {
|
|
|
|
serializeUser (
|
|
|
|
user: Profile,
|
|
|
|
done: (err: Error | null, user: Profile) => void
|
|
|
|
): any {
|
|
|
|
done(null, user)
|
|
|
|
}
|
|
|
|
|
|
|
|
deserializeUser (
|
|
|
|
payload: Profile,
|
|
|
|
done: (err: Error | null, user: Profile) => void
|
|
|
|
): any {
|
|
|
|
done(null, payload)
|
|
|
|
}
|
|
|
|
}
|