Fix: 419 Session-Fehler leitet direkt zum Login weiter statt Livewire-Dialog

main v1.1.453
boban 2026-04-30 18:41:19 +02:00
parent eeae972d8b
commit 97cc0091c0
1 changed files with 6 additions and 2 deletions

View File

@ -226,14 +226,18 @@
@livewireScripts @livewireScripts
@livewire('wire-elements-modal') @livewire('wire-elements-modal')
<script> <script>
// 503 (Wartungsmodus) → sofortiger Page-Reload statt Livewire-Fehlerdialog // 503 (Wartungsmodus) → Reload | 419 (Session abgelaufen) → Login
;(function () { ;(function () {
var _fetch = window.fetch var _fetch = window.fetch
window.fetch = function () { window.fetch = function () {
return _fetch.apply(this, arguments).then(function (resp) { return _fetch.apply(this, arguments).then(function (resp) {
if (resp.status === 503) { if (resp.status === 503) {
window.location.reload() window.location.reload()
return new Promise(function () {}) // Livewire-Chain abbrechen return new Promise(function () {})
}
if (resp.status === 419) {
window.location.href = '{{ route('login') }}'
return new Promise(function () {})
} }
return resp return resp
}) })