update: redirect to login and hide page on logged out
This commit is contained in:
@ -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));
|
||||
|
Reference in New Issue
Block a user