make logout refresh the current page instead of going to the frontpage

master
Aevann 2023-08-08 21:04:39 +03:00
parent da98e32ba8
commit 8b1f7baa74
2 changed files with 2 additions and 11 deletions

View File

@ -417,15 +417,6 @@ if (gbrowser == 'iphone' || gbrowser == 'mac') {
}
}
function logout(t) {
postToast(t, '/logout',
{
},
() => {
location.href = '/'
});
}
const screen_width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
function focusSearchBar(element)
{

View File

@ -315,7 +315,7 @@
<a class="dropdown-item" href="/archives"><i class="fas fa-book fa-fw mr-3"></i>Archives</a>
{% endif %}
<a class="dropdown-item" href="/contact"><i class="fas fa-file-signature fa-fw mr-3"></i>Contact us</a>
<button type="button" class="dropdown-item" data-nonce="{{g.nonce}}" data-onclick="logout(this)"><i class="fas fa-sign-out fa-fw mr-3"></i>Log out</button>
<button type="button" class="dropdown-item" data-nonce="{{g.nonce}}" data-onclick="postToastReload(this, '/logout')"><i class="fas fa-sign-out fa-fw mr-3"></i>Log out</button>
</div>
</div>
</li>
@ -382,7 +382,7 @@
<a class="nav-item nav-link" href="/contact"><i class="fas fa-file-signature fa-fw mr-3"></i>Contact us</a>
<button type="button" class="nav-item border-top border-bottom mt-2 pt-2 nav-link" data-nonce="{{g.nonce}}" data-onclick="logout(this)"><i class="fas fa-sign-out fa-fw mr-3 text-danger"></i>Log out</button>
<button type="button" class="nav-item border-top border-bottom mt-2 pt-2 nav-link" data-nonce="{{g.nonce}}" data-onclick="postToastReload(this, '/logout')"><i class="fas fa-sign-out fa-fw mr-3 text-danger"></i>Log out</button>
{% else %}
<li class="nav-item d-flex align-items-center justify-content-center pb-3">
<a class="btn btn-primary btn-block" href="/contact">Contact us</a>