https://github.com/chibaba/HackerbayBackend/blob/9b472f7c7cbd867bf2f5e24500b84d5029ce1b7c/routes/routes.js#L216 Are you not trying to sign a json web token with `user._id` ? Why using User.id ?