From d0663dcbd4479ebe695a515d3b08820d63d1562a Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 30 Oct 2021 23:27:59 +0300 Subject: [PATCH] fix: use POST for admin logout route (#3710) Quick fix for logging out from the admin panel as the auth route was changed from GET to POST. --- resources/views/layouts/admin.blade.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/views/layouts/admin.blade.php b/resources/views/layouts/admin.blade.php index e885183e..faadc2c8 100644 --- a/resources/views/layouts/admin.blade.php +++ b/resources/views/layouts/admin.blade.php @@ -195,9 +195,17 @@ cancelButtonColor: '#d33', confirmButtonText: 'Log out' }, function () { - window.location = $(that).attr('href'); + $.ajax({ + type: 'POST', + url: '{{ route('auth.logout') }}', + data: { + _token: '{{ csrf_token() }}' + },complete: function () { + window.location.href = '{{route('auth.login')}}'; + } }); }); + }); @endif