fix login bug
This commit is contained in:
parent
61de380588
commit
c7bca43b44
2 changed files with 9 additions and 6 deletions
|
@ -18,7 +18,7 @@
|
|||
<div class="collapse navbar-collapse" id="navbarNav" style="display:none!important">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#" id="usersNavLink">Users</a>
|
||||
<a class="nav-link" href="#" id="usersNavLink">Users</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" id="botsNavLink">Bots</a>
|
||||
|
|
|
@ -236,11 +236,14 @@ elements.createBotForm.addEventListener('submit', async e => {
|
|||
var session = await auth.loadSession(token);
|
||||
if (session.success) {
|
||||
if (session.rank! !== 2) {
|
||||
if (!session.developer) {
|
||||
await auth.logout();
|
||||
localStorage.removeItem(`collabvm_session_${new URL(Config.APIEndpoint).host}`);
|
||||
loadLoginForm();
|
||||
}
|
||||
loadUsersView();
|
||||
elements.usersNavLink.style.display = "none";
|
||||
loadBotsView();
|
||||
} else loadUsersView();
|
||||
loadAdminView();
|
||||
} else {
|
||||
localStorage.removeItem(`collabvm_session_${new URL(Config.APIEndpoint).host}`);
|
||||
|
|
Loading…
Reference in a new issue