Fix jwt-token

This commit is contained in:
2025-09-16 21:23:56 +02:00
parent 366cd709b3
commit 2dfb02a2ad

View File

@@ -583,8 +583,8 @@ router.post('/refresh', async (req, res) => {
}
// Find user to ensure they still exist and are active
const { User } = require('../models');
const user = await User.findOne({
const models = global.__TEST_MODELS__ || require('../models');
const user = await models.User.findOne({
where: { id: decoded.userId, is_active: true }
});
@@ -665,8 +665,8 @@ router.get('/me', async (req, res) => {
}
// Find user
const { User } = require('../models');
const user = await User.findOne({
const models = global.__TEST_MODELS__ || require('../models');
const user = await models.User.findOne({
where: { id: decoded.userId, is_active: true },
attributes: { exclude: ['password_hash'] }
});