Skip to content

[5.x] Add heartbeat to keep CSRF tokens alive#1274

Merged
royduin merged 3 commits into
masterfrom
feature/heartbeat
May 6, 2026
Merged

[5.x] Add heartbeat to keep CSRF tokens alive#1274
royduin merged 3 commits into
masterfrom
feature/heartbeat

Conversation

@Jade-GG
Copy link
Copy Markdown
Collaborator

@Jade-GG Jade-GG commented May 4, 2026

ref: RAP-1888

This PR adds an empty route under the web middleware to keep the CSRF token alive, which it then calls every 15 minutes. This should significantly reduce the issue where people are doing requests with invalid CSRF tokens.

@Jade-GG Jade-GG requested review from indykoning and royduin as code owners May 4, 2026 12:13
@royduin
Copy link
Copy Markdown
Member

royduin commented May 6, 2026

@Jade-GG
Copy link
Copy Markdown
Collaborator Author

Jade-GG commented May 6, 2026

This vs https://github.com/mikebronner/laravel-caffeine?

Looks like that package does a similar thing but just has some methods to make it not run on certain pages. It's also using classic ajax requests. Seems both unnecessary and overkill in our case. It'll end up doing the same thing as this, except as an unnecessary extra dependency with more complexity.

@royduin royduin merged commit 5468e55 into master May 6, 2026
12 of 15 checks passed
@royduin royduin deleted the feature/heartbeat branch May 6, 2026 11:13
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.

3 participants