ui: hide or show login button
This commit is contained in:
parent
89db25fa85
commit
522237b4d2
@ -25,4 +25,15 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
||||
})
|
||||
});
|
||||
|
||||
//- Header login hide/show
|
||||
if(document.querySelector('sib-auth').getUser() !== null) {
|
||||
document.querySelector('button[role="log in"]').style.display = 'none';
|
||||
//- Token expired, hack for ask relogin
|
||||
if(new Date(document.querySelector('sib-auth').getUser().expires_at*1000) <= new Date()) {
|
||||
document.querySelector('button[role="log in"]').style.display = '';
|
||||
document.querySelector('button[role="log in"]').style.color = 'red';
|
||||
document.querySelector('button[role="log in"]').innerHTML = 'Re-login';
|
||||
}
|
||||
}
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user