1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

Merge pull request #2558 from Budibase/fix/multi-tenancy-prod

Fixing issue with backwards compatibility for multi-tenancy
This commit is contained in:
Michael Drury 2021-09-06 15:19:18 +01:00 committed by GitHub
commit de5146454d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,10 @@ exports.getUser = async (userId, tenantId = null) => {
user = await getGlobalDB(tenantId).get(userId)
client.store(userId, user, EXPIRY_SECONDS)
}
if (user && !user.tenantId && tenantId) {
// make sure the tenant ID is always correct/set
user.tenantId = tenantId
}
return user
}