F
Filament7mo ago
jgreco

Fileupload on registration page - 419 error

For full context, we have a Filament app with 2 panels - Admin & Member. When a member registers, an Admin receives a notification and they must review the member user details to approve access. Middleware blocks the member user from accessing the panel until they're approved. In order for a member to register they must provide an ID card upload. We've discovered that when the fileupload field is set, and Sign Up is clicked, then the session expires. Console shows a call to /livewire/update returns 419. We are trying to understand how the fileupload field causes the page to expire. Thank you!
3 Replies
jgreco
jgrecoOP7mo ago
UPDATE: session()->regenerate(); is what causes this to happen. Overrode the register() method and removed this line. It's a bit glitchy but it works without the 419 error. I assume the session becomes invalid before the fileupload can finish saving. Is there any negative implication to not regenerating the session during registration?
TMS
TMS3mo ago
I'm also encountering this error when using the FileUpload field. Your solution works but introduces a huge vulnerability into your web app - I'm talking about session fixation here. @jgreco If only there was a way to wait for the FileUpload field to save (completing the upload) first before regenerating the session.
hyperion-mx
hyperion-mx3mo ago
why not taking a different approach?
1- user register as normal
2- registration success redirect to next step to upload the ID
2.5- user status updated to pending ID upload (in case they leave before they upload)
3- finish upload and show thank you we will review etc
3.5- status updated to pending review
from now on the middleware redirect them to Pending Review Page until approved then they access as normal
1- user register as normal
2- registration success redirect to next step to upload the ID
2.5- user status updated to pending ID upload (in case they leave before they upload)
3- finish upload and show thank you we will review etc
3.5- status updated to pending review
from now on the middleware redirect them to Pending Review Page until approved then they access as normal
Want results from more Discord servers?
Add your server