Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add livewire hook to refresh page on 419 error. #105

Merged
merged 1 commit into from
Dec 20, 2022
Merged

Add livewire hook to refresh page on 419 error. #105

merged 1 commit into from
Dec 20, 2022

Conversation

dbohn
Copy link

@dbohn dbohn commented Dec 20, 2022

Thank you for this awesome package!

The documentation says, that the livewire routes should be excluded from the CSRF verification to enable permanent refreshing.

This seems a bit odd to me, especially if there are other pages, that use livewire, in the same app.

On the other hand, livewire provides a way to define a callback, that gets called if a 419 error occurred, instead of the default confirm dialog.

As we most likely want to refresh our dashboard in this case to preserve refresh capabilities, the page could be refreshed without any confirmation.

Maybe I'm not seeing the complete picture here, but I thought this might be a suitable change for a dashboard!

Livewire provides a way to define a callback, that gets called if a 419 error occurred.
For our dashboard, we most likely want to refresh the page if this happens, so that our updates run again.
@dbohn dbohn changed the title Add livewire hook to refresh page on 419 error. WIP: Add livewire hook to refresh page on 419 error. Dec 20, 2022
@dbohn dbohn changed the title WIP: Add livewire hook to refresh page on 419 error. Add livewire hook to refresh page on 419 error. Dec 20, 2022
@freekmurze freekmurze merged commit 686c72e into spatie:main Dec 20, 2022
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants