tiny refactorizing
This commit is contained in:
parent
e799724b3b
commit
eec6df3301
5 changed files with 116 additions and 17 deletions
|
@ -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
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue