Fix: 419 Session-Fehler leitet direkt zum Login weiter statt Livewire-Dialog
parent
eeae972d8b
commit
97cc0091c0
|
|
@ -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
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue