Adding error to check why logout might have occurred as well as a possible fix.

This commit is contained in:
mike12345567 2023-03-28 15:14:28 +01:00
parent 117edaa8cb
commit f637512317
1 changed files with 2 additions and 2 deletions

View File

@ -41,13 +41,13 @@
return
}
if (user.tenantId !== urlTenantId) {
if (urlTenantId && user.tenantId !== urlTenantId) {
// user should not be here - play it safe and log them out
try {
await auth.logout()
await auth.setOrganisation(null)
} catch (error) {
// Swallow error and do nothing
console.error("Tenant mis-match, logout.")
}
}
} else {