Fix jwt-token

This commit is contained in:
2025-09-15 15:31:08 +02:00
parent 8f18fe4b24
commit 548bebb3ab
2 changed files with 3 additions and 4 deletions

View File

@@ -10,7 +10,6 @@ module.exports = (sequelize) => {
username: { username: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
unique: true,
validate: { validate: {
len: [3, 50] len: [3, 50]
} }
@@ -101,7 +100,9 @@ module.exports = (sequelize) => {
fields: ['email'] fields: ['email']
}, },
{ {
fields: ['username'] fields: ['username', 'tenant_id'],
unique: true,
name: 'unique_username_per_tenant'
}, },
{ {
fields: ['phone_number'] fields: ['phone_number']

View File

@@ -65,7 +65,6 @@ describe('Models', () => {
const tenant2 = await createTestTenant({ slug: 'tenant2' }); const tenant2 = await createTestTenant({ slug: 'tenant2' });
const timestamp = Date.now(); const timestamp = Date.now();
console.log('Creating user1 with tenant:', tenant1.id);
const user1 = await models.User.create({ const user1 = await models.User.create({
username: 'testuser', username: 'testuser',
email: `test1-${timestamp}@example.com`, email: `test1-${timestamp}@example.com`,
@@ -73,7 +72,6 @@ describe('Models', () => {
tenant_id: tenant1.id tenant_id: tenant1.id
}); });
console.log('Creating user2 with tenant:', tenant2.id);
const user2 = await models.User.create({ const user2 = await models.User.create({
username: 'testuser', username: 'testuser',
email: `test2-${timestamp}@example.com`, email: `test2-${timestamp}@example.com`,