expected payload to be a plain object json web token code example
Example: Error: Expected "payload" to be a plain object. at validate
const token = jwt.sign(user.toJSON(), config.secret, {
expiresIn: 604800 // 1 week
});
const token = jwt.sign(user.toJSON(), config.secret, {
expiresIn: 604800 // 1 week
});