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#search-icon.icon-magnifier(aria-hidden='true')
|
||||||
//- i#close-search-icon.icon-close(aria-hidden='true')
|
//- i#close-search-icon.icon-close(aria-hidden='true')
|
||||||
|
|
||||||
sib-notifications(
|
sib-notifications.notLoggedIn(
|
||||||
nested-field="inbox"
|
nested-field="inbox"
|
||||||
bind-user
|
bind-user
|
||||||
)
|
)
|
||||||
@ -33,11 +33,11 @@ details#user-controls.notLoggedIn
|
|||||||
sib-link(next='admin') Admin
|
sib-link(next='admin') Admin
|
||||||
button(role='log out' onclick="document.querySelector('sib-auth').logout();") Log out
|
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
|
button.notLoggedIn.mobile-menu-icon.icon-menu#toggleMainMenu
|
||||||
|
|
||||||
sib-auth
|
sib-auth(style='display:none!important')
|
||||||
sib-auth-provider(
|
sib-auth-provider(
|
||||||
data-authority=`${authority}`
|
data-authority=`${authority}`
|
||||||
data-id=`${authorityName || "authority"}`
|
data-id=`${authorityName || "authority"}`
|
||||||
|
@ -13,7 +13,8 @@ html(lang="en")
|
|||||||
body
|
body
|
||||||
header#header(role='banner')
|
header#header(role='banner')
|
||||||
include header.pug
|
include header.pug
|
||||||
main
|
|
||||||
|
main.notLoggedIn
|
||||||
include menu-left.pug
|
include menu-left.pug
|
||||||
div#viewport
|
div#viewport
|
||||||
|
|
||||||
@ -42,4 +43,4 @@ html(lang="en")
|
|||||||
include page-events.pug
|
include page-events.pug
|
||||||
|
|
||||||
#admin(hidden).with-sidebar
|
#admin(hidden).with-sidebar
|
||||||
include page-admin.pug
|
include page-admin.pug
|
@ -214,7 +214,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|||||||
.forEach(el => (el.style.visibility = "visible"));
|
.forEach(el => (el.style.visibility = "visible"));
|
||||||
// Hide login button if already logged
|
// Hide login button if already logged
|
||||||
document
|
document
|
||||||
.querySelector('button[role="log in"]')
|
.querySelector('.loggedIn')
|
||||||
.setAttribute("style", "display:none !important");
|
.setAttribute("style", "display:none !important");
|
||||||
document.querySelectorAll('sib-display, sib-form').forEach(element => {
|
document.querySelectorAll('sib-display, sib-form').forEach(element => {
|
||||||
// Set current user id on set-user-id of sib-display
|
// Set current user id on set-user-id of sib-display
|
||||||
@ -228,6 +228,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|||||||
"display:none !important"
|
"display:none !important"
|
||||||
); // Hide Join button
|
); // Hide Join button
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
document.querySelector('sib-auth').login();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => console.log(error));
|
.catch(error => console.log(error));
|
||||||
|
@ -56,10 +56,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.notLoggedIn {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
sib-notifications {
|
sib-notifications {
|
||||||
|
|
||||||
@include breakpoint(sm) {
|
@include breakpoint(sm) {
|
||||||
|
@ -35,6 +35,10 @@ $breakpoints: (phone: 480px,
|
|||||||
backface-visibility: hidden;
|
backface-visibility: hidden;
|
||||||
/*will-change: overflow;*/
|
/*will-change: overflow;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notLoggedIn {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add scrollbar to the left and right menu, and to the content */
|
/* Add scrollbar to the left and right menu, and to the content */
|
||||||
|
Loading…
Reference in New Issue
Block a user