Cannot read property 'picture' of undefined
hstandeffer opened this issue · comments
Followed the basic steps to cloning and setting up the project and am getting the following error, simply after creating an account seemingly successfully:
TypeError: C:\Users\---\---\---\views\partials\header.pug:27
25| li.nav-item.dropdown(class=(title === 'Account Management') ? 'active' : undefined)
26| a.nav-link.dropdown-toggle(href='#', data-toggle='dropdown')
> 27| if user.profile.picture
28| img(src=user.profile.picture, alt=(user.profile.name || user.email || user.id))
29| else
30| img(src=user.gravatar(60), alt=(user.profile.name || user.email || user.id))
Cannot read property 'picture' of undefined
I can reproduce the same issue.
I found this in passport.ts:
passport.deserializeUser((id, done) => {
User.findById(id, (err: NativeError, user: UserDocument) => {
done(err, user.id);
});
});
Should be
passport.deserializeUser((id, done) => {
User.findById(id, (err: NativeError, user: UserDocument) => {
done(err, user);
});
});
instead!? (returning user
instead of user.id
)