This commit is contained in:
James Cole
2021-11-13 10:54:04 +01:00
parent 6d3c858cbe
commit 16391fe99c
4 changed files with 11 additions and 9 deletions

View File

@@ -25,6 +25,12 @@ $(function () {
configAccounting(currencySymbol);
// on submit of logout button:
$('.logout-link').click(function(e) {
e.preventDefault();
document.getElementById('logout-form').submit();
});
// on submit of form, disable any button in form:
$('form.form-horizontal:not(.nodisablebutton)').on('submit', function () {
$('button[type="submit"]').prop('disabled', true);

View File

@@ -239,6 +239,9 @@
);
}
</script>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
</form>
</body>
</html>

View File

@@ -224,11 +224,8 @@
{% if 'remote_user_guard' != authGuard or '' != logoutUri %}
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
</form>
<li>
<a href="{{ route('logout') }}" onclick="event.preventDefault();document.getElementById('logout-form').submit();">
<a href="{{ route('logout') }}" class="logout-link">
<span class="fa fa-sign-out fa-fw"></span>
<span>{{ 'logout'|_ }}</span>
</a>

View File

@@ -53,11 +53,7 @@
</li>
{% endif %}
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
</form>
<li><a href="{{ route('logout') }}" onclick="event.preventDefault();document.getElementById('logout-form').submit();">{{ 'logout'|_ }}</a></li>
<li><a href="{{ route('logout') }}" class="logout-link">{{ 'logout'|_ }}</a></li>
{% if true == isInternalAuth and true == isInternalIdentity %}
<li>