fix: workaround sibAuth
This commit is contained in:
parent
fbedd82642
commit
496c72f1ae
@ -1,9 +1,13 @@
|
||||
window.requestLogin = false;
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const sibAuth = document.querySelector("sib-auth");
|
||||
const timeoutNoUser = setTimeout(() => {
|
||||
sibAuth.login();
|
||||
}, 15000);
|
||||
if (sibAuth) {
|
||||
sibAuth.getUser()
|
||||
.then(user => {
|
||||
clearTimeout(timeoutNoUser);
|
||||
if (user !== null) {
|
||||
document
|
||||
.querySelectorAll(".notLoggedIn")
|
||||
|
@ -81,9 +81,13 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
// Workaround - No "navigate" event after the login on `/login`
|
||||
if (window.location.pathname == "/login") {
|
||||
const sibAuth = document.querySelector("sib-auth");
|
||||
const timeoutNoUser = setTimeout(() => {
|
||||
sibAuth.login();
|
||||
}, 15000);
|
||||
if (sibAuth) {
|
||||
sibAuth.getUser()
|
||||
.then(user => {
|
||||
clearTimeout(timeoutNoUser);
|
||||
if (user !== null) {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('requestNavigation', {
|
||||
@ -124,9 +128,13 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
closeUserControls();
|
||||
if (e.detail.route.startsWith('login')) {
|
||||
const sibAuth = document.querySelector("sib-auth");
|
||||
const timeoutNoUser2 = setTimeout(() => {
|
||||
sibAuth.login();
|
||||
}, 15000);
|
||||
if (sibAuth) {
|
||||
sibAuth.getUser()
|
||||
.then(user => {
|
||||
clearTimeout(timeoutNoUser2);
|
||||
if (user !== null) {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('requestNavigation', {
|
||||
|
Loading…
Reference in New Issue
Block a user