tiny refactorizing

This commit is contained in:
waveringana 2024-05-11 22:17:56 -04:00
parent e799724b3b
commit eec6df3301
5 changed files with 116 additions and 17 deletions

View file

@ -46,12 +46,9 @@ passport.use(
}),
);
passport.serializeUser(function (user: User, cb) {
process.nextTick(function () {
cb(null, {
id: user.id,
username: user.username,
});
passport.serializeUser((user: User, cb: (err: Error | null, id?: User) => void) => {
process.nextTick(() => {
cb(null, user); // No need to reconstruct the user object
});
});