Browse Source

Handle no license found

pull/4525/head
Rory Powell 4 years ago
parent
commit
091f054e8a
  1. 4
      packages/backend-core/src/cache/user.js
  2. 5
      packages/backend-core/src/cloud/accounts.js

4
packages/backend-core/src/cache/user.js

@ -17,7 +17,9 @@ const populateFromDB = async (userId, tenantId) => {
// TODO: Break this out into it's own cache
if (account) {
const license = await accounts.getLicense(user.tenantId)
user.license = license
if (license) {
user.license = license
}
user.account = account
user.accountPortalAccess = true
}

5
packages/backend-core/src/cloud/accounts.js

@ -31,6 +31,11 @@ exports.getLicense = async tenantId => {
},
})
if (response.status === 404) {
// no license for the tenant
return
}
if (response.status !== 200) {
const text = await response.text()
console.error("Error getting license: ", text)

Loading…
Cancel
Save