logs not being logged in nodejs with JWT

I'm following this tutorial to combine JWT authentication with Express routing and Sequelize db management. In the tutorial they use MongoDB while I use Sequelize, but the end-result should be the same.

In an error condition, you should be setting the status code to 500. res.status(500).json(...).

The properties of an Error are non-enumerable. This means that the JSON serializer doesn't see the properties like message, stack, etc. Since there are no enumerable properties available, an Error serializes to {}.

In your catch, add console.error(err.stack) to see why the sign operation fails. You could also provide a more useful error to the client.