Skip to content

Page expired (419) on user registration using the FileUpload component #13394

@rpereira-tae

Description

@rpereira-tae

Package

filament/filament

Package Version

v3.2.92

Laravel Version

v11.11.1

Livewire Version

v3.5.1

PHP Version

PHP 8.2

Problem description

Hello! I’ve been trying to create a custom user registration page in Filament, but I’ve been dealing with a 419 "The page has expired" error when registering. The user does get registered, and the notification is sent successfully, but I always encounter this 419 error after clicking the "Sign up" button.

Yesterday, I noticed that if I remove the FileUpload component from the registration form, I don’t get that 419 error. It seems quite strange to me.

2024-06-25.14-30-36.mp4

It seems that when the image is uploaded to the temp directory the cookies are refreshed at least two times.

image

I'm using Redis as the session driver.

Expected behavior

The user should be registered without getting the 419 "The page has expired".

Steps to reproduce

  1. Create a custom registration page that extends Filament\Pages\Auth\Register.
  2. Add the custom page to one of the panel providers (such as AdminPanelProvider).
  3. Add the following form method:
public function form(Form $form): Form
{
    return $form
        ->schema([
            Forms\Components\Section::make('information')
                ->schema([
                    $this->getNameFormComponent(),

                    $this->getEmailFormComponent(),

                    $this->getPasswordFormComponent(),

                    $this->getPasswordConfirmationFormComponent(),

                    Forms\Components\FileUpload::make('image')
                        ->required()
                        ->image()
                        ->maxFiles(1)
                        ->placeholder('profile_image.jpg'),
                ]),
        ]);
}
  1. Register the user in the view.

I published a reproduction repository if you want to try it out.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/rpereira-tae/test-app

Relevant log output

There was not log from the `laravel.log` file.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions