Browse Source
Merge pull request #2558 from Budibase/fix/multi-tenancy-prod
Fixing issue with backwards compatibility for multi-tenancy
pull/2577/head
Michael Drury
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
0 deletions
-
packages/auth/src/cache/user.js
|
|
|
@ -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 |
|
|
|
} |
|
|
|
|
|
|
|
|