update: redirect to login and hide page on logged out

This commit is contained in:
Jean-Baptiste Pasquier
2020-02-19 17:03:47 +01:00
parent 8042b179c6
commit 3e14cb91a4
5 changed files with 13 additions and 10 deletions

View File

@ -214,7 +214,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
.forEach(el => (el.style.visibility = "visible"));
// Hide login button if already logged
document
.querySelector('button[role="log in"]')
.querySelector('.loggedIn')
.setAttribute("style", "display:none !important");
document.querySelectorAll('sib-display, sib-form').forEach(element => {
// Set current user id on set-user-id of sib-display
@ -228,6 +228,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
"display:none !important"
); // Hide Join button
}
} else {
document.querySelector('sib-auth').login();
}
})
.catch(error => console.log(error));