Skip to content

Commit f85e6fe

Browse files
author
App Generator
committed
Patch #7 - Runtime Error / Expected "payload" to be a plain object
1 parent e2f2556 commit f85e6fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/users.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ router.post('/login', (req, res) => {
8787

8888
bcrypt.compare(password, user.password, (_err2, isMatch) => {
8989
if (isMatch) {
90-
const token = jwt.sign(user, config.secret, {
90+
const token = jwt.sign(user.toJSON(), config.secret, {
9191
expiresIn: 86400, // 1 week
9292
});
9393

0 commit comments

Comments
 (0)