hubl/src/components/orbit-auto-login.js

24 lines
620 B
JavaScript
Raw Normal View History

import {
Sib
2021-05-11 08:50:17 +00:00
} from 'https://cdn.skypack.dev/@startinblox/core@0.17';
2021-02-17 17:40:12 +00:00
2021-06-15 11:48:49 +00:00
export const OrbitAutoLogin = {
name: 'orbit-auto-login',
2021-02-17 17:40:12 +00:00
created() {
2021-02-23 20:43:21 +00:00
if (window.location.pathname == "/login") {
document
.querySelectorAll(".loggedIn-loader")
.forEach(el => (el.style.display = "flex"));
window.dispatchEvent(
new CustomEvent('requestNavigation', {
detail: {
2021-06-15 11:48:49 +00:00
route: window.orbit.getRoute((window.orbit.defaultRoute || "dashboard"), true)
2021-02-23 20:43:21 +00:00
}
}),
);
document.querySelector("sib-auth").login();
}
2021-02-17 17:40:12 +00:00
}
}
2021-06-15 11:48:49 +00:00
Sib.register(OrbitAutoLogin);