Fix jwt-token

This commit is contained in:
2025-09-15 06:18:47 +02:00
parent c29a5aed67
commit 57710609f7

View File

@@ -92,7 +92,7 @@ describe('Authentication Middleware', () => {
const token = jwt.sign(
{
userId: user.id,
userId: user.id.toString(), // Convert UUID to string
username: user.username,
role: user.role,
email: user.email
@@ -121,7 +121,7 @@ describe('Authentication Middleware', () => {
const user = await createTestUser({ username: 'testuser', tenant_id: tenant.id });
const token = jwt.sign(
{
userId: user.id,
userId: user.id.toString(), // Convert UUID to string
username: user.username,
role: user.role,
tenantId: tenant.slug
@@ -168,7 +168,7 @@ describe('Authentication Middleware', () => {
is_active: false
});
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',
{ expiresIn: '1h' }
);