We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2f2556 commit f85e6feCopy full SHA for f85e6fe
1 file changed
src/routes/users.ts
@@ -87,7 +87,7 @@ router.post('/login', (req, res) => {
87
88
bcrypt.compare(password, user.password, (_err2, isMatch) => {
89
if (isMatch) {
90
- const token = jwt.sign(user, config.secret, {
+ const token = jwt.sign(user.toJSON(), config.secret, {
91
expiresIn: 86400, // 1 week
92
});
93
0 commit comments