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); 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: // on submit of form, disable any button in form:
$('form.form-horizontal:not(.nodisablebutton)').on('submit', function () { $('form.form-horizontal:not(.nodisablebutton)').on('submit', function () {
$('button[type="submit"]').prop('disabled', true); $('button[type="submit"]').prop('disabled', true);

View File

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

View File

@@ -224,11 +224,8 @@
{% if 'remote_user_guard' != authGuard or '' != logoutUri %} {% 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> <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 class="fa fa-sign-out fa-fw"></span>
<span>{{ 'logout'|_ }}</span> <span>{{ 'logout'|_ }}</span>
</a> </a>

View File

@@ -53,11 +53,7 @@
</li> </li>
{% endif %} {% endif %}
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"> <li><a href="{{ route('logout') }}" class="logout-link">{{ 'logout'|_ }}</a></li>
<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>
{% if true == isInternalAuth and true == isInternalIdentity %} {% if true == isInternalAuth and true == isInternalIdentity %}
<li> <li>