update: redirect to login and hide page on logged out
This commit is contained in:
parent
8042b179c6
commit
3e14cb91a4
@ -7,7 +7,7 @@
|
||||
//- i#search-icon.icon-magnifier(aria-hidden='true')
|
||||
//- i#close-search-icon.icon-close(aria-hidden='true')
|
||||
|
||||
sib-notifications(
|
||||
sib-notifications.notLoggedIn(
|
||||
nested-field="inbox"
|
||||
bind-user
|
||||
)
|
||||
@ -33,11 +33,11 @@ details#user-controls.notLoggedIn
|
||||
sib-link(next='admin') Admin
|
||||
button(role='log out' onclick="document.querySelector('sib-auth').logout();") Log out
|
||||
|
||||
button(role='log in' onclick="document.querySelector('sib-auth').login();") Login
|
||||
button.loggedIn(role='log in' onclick="document.querySelector('sib-auth').login();") Login
|
||||
|
||||
button.notLoggedIn.mobile-menu-icon.icon-menu#toggleMainMenu
|
||||
|
||||
sib-auth
|
||||
sib-auth(style='display:none!important')
|
||||
sib-auth-provider(
|
||||
data-authority=`${authority}`
|
||||
data-id=`${authorityName || "authority"}`
|
||||
|
@ -13,7 +13,8 @@ html(lang="en")
|
||||
body
|
||||
header#header(role='banner')
|
||||
include header.pug
|
||||
main
|
||||
|
||||
main.notLoggedIn
|
||||
include menu-left.pug
|
||||
div#viewport
|
||||
|
||||
|
@ -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));
|
||||
|
@ -56,10 +56,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.notLoggedIn {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
sib-notifications {
|
||||
|
||||
@include breakpoint(sm) {
|
||||
|
@ -35,6 +35,10 @@ $breakpoints: (phone: 480px,
|
||||
backface-visibility: hidden;
|
||||
/*will-change: overflow;*/
|
||||
}
|
||||
|
||||
.notLoggedIn {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add scrollbar to the left and right menu, and to the content */
|
||||
|
Loading…
Reference in New Issue
Block a user