ui: add login routing and docs
This commit is contained in:
@ -286,19 +286,25 @@
|
||||
}
|
||||
|
||||
// Authentication
|
||||
function setPath(path) {
|
||||
if (window.location.pathname !== path) {
|
||||
history.replaceState(null, '', path);
|
||||
}
|
||||
}
|
||||
|
||||
function showLanding() {
|
||||
document.getElementById('loginLanding').classList.remove('hidden');
|
||||
document.getElementById('appContainer').classList.add('hidden');
|
||||
document.getElementById('headerVersion').textContent = 'v-';
|
||||
history.replaceState(null, '', '#login');
|
||||
if (window.location.pathname !== '/login') {
|
||||
setPath('/login');
|
||||
}
|
||||
}
|
||||
|
||||
function showApp() {
|
||||
document.getElementById('loginLanding').classList.add('hidden');
|
||||
document.getElementById('appContainer').classList.remove('hidden');
|
||||
if (window.location.hash !== '#app') {
|
||||
history.replaceState(null, '', '#app');
|
||||
}
|
||||
setPath('/dashboard');
|
||||
}
|
||||
|
||||
async function checkSession() {
|
||||
|
||||
Reference in New Issue
Block a user