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.
25 lines
510 B
25 lines
510 B
2 years ago
|
import { Injectable } from '@nestjs/common'
|
||
|
import { PassportSerializer } from '@nestjs/passport'
|
||
|
import { type Profile } from 'passport-42'
|
||
|
|
||
|
@Injectable()
|
||
|
export class SessionSerializer extends PassportSerializer {
|
||
|
constructor () {
|
||
|
super()
|
||
|
}
|
||
|
|
||
|
serializeUser (
|
||
|
user: Profile,
|
||
|
done: (err: Error | null, user: Profile) => void
|
||
|
): any {
|
||
|
done(null, user)
|
||
|
}
|
||
|
|
||
|
deserializeUser (
|
||
|
payload: Profile,
|
||
|
done: (err: Error | null, user: Profile) => void
|
||
|
) {
|
||
|
done(null, payload)
|
||
|
}
|
||
|
}
|