I am making a web application using nodejs and angular cli I\'m using JWT to authenticate my login function . But when I process it threw this error
Err
Change
const token = jwt.sign(user, config.secret, { expiresIn: 10080 });
To
const token = jwt.sign(user.toJSON(), config.secret, { expiresIn: 10080 });