fix: autologin when no community

This commit is contained in:
Jean-Baptiste Pasquier 2021-02-23 21:43:21 +01:00
parent b15a5a637a
commit 34a2203b55
1 changed files with 13 additions and 11 deletions

View File

@ -5,17 +5,19 @@ import {
export const HublAutoLogin = { export const HublAutoLogin = {
name: 'hubl-auto-login', name: 'hubl-auto-login',
created() { created() {
document if (window.location.pathname == "/login") {
.querySelectorAll(".loggedIn-loader") document
.forEach(el => (el.style.display = "flex")); .querySelectorAll(".loggedIn-loader")
window.dispatchEvent( .forEach(el => (el.style.display = "flex"));
new CustomEvent('requestNavigation', { window.dispatchEvent(
detail: { new CustomEvent('requestNavigation', {
route: window.hubl.getRoute("dashboard", true) detail: {
} route: window.hubl.getRoute("dashboard", true)
}), }
); }),
document.querySelector("sib-auth").login(); );
document.querySelector("sib-auth").login();
}
} }
} }