Fix jwt-token
This commit is contained in:
@@ -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'] }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user