Fix jwt-token
This commit is contained in:
@@ -92,7 +92,7 @@ describe('Authentication Middleware', () => {
|
|||||||
|
|
||||||
const token = jwt.sign(
|
const token = jwt.sign(
|
||||||
{
|
{
|
||||||
userId: user.id,
|
userId: user.id.toString(), // Convert UUID to string
|
||||||
username: user.username,
|
username: user.username,
|
||||||
role: user.role,
|
role: user.role,
|
||||||
email: user.email
|
email: user.email
|
||||||
@@ -121,7 +121,7 @@ describe('Authentication Middleware', () => {
|
|||||||
const user = await createTestUser({ username: 'testuser', tenant_id: tenant.id });
|
const user = await createTestUser({ username: 'testuser', tenant_id: tenant.id });
|
||||||
const token = jwt.sign(
|
const token = jwt.sign(
|
||||||
{
|
{
|
||||||
userId: user.id,
|
userId: user.id.toString(), // Convert UUID to string
|
||||||
username: user.username,
|
username: user.username,
|
||||||
role: user.role,
|
role: user.role,
|
||||||
tenantId: tenant.slug
|
tenantId: tenant.slug
|
||||||
@@ -168,7 +168,7 @@ describe('Authentication Middleware', () => {
|
|||||||
is_active: false
|
is_active: false
|
||||||
});
|
});
|
||||||
const token = jwt.sign(
|
const token = jwt.sign(
|
||||||
{ userId: user.id, username: user.username },
|
{ userId: user.id.toString(), username: user.username }, // Convert UUID to string
|
||||||
process.env.JWT_SECRET || 'test-secret',
|
process.env.JWT_SECRET || 'test-secret',
|
||||||
{ expiresIn: '1h' }
|
{ expiresIn: '1h' }
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user