Open leonardyrj opened 5 months ago
I would accept a PR to allow customisation of the guard
Eu aceitaria um PR para permitir a personalização da guarda
The problem is in this action middleware, you would have to somehow add additional middleware.
Correct me if I'm wrong. The Action module is to be used independently, so I can't get the guard from the panel.
Would I have to manually add it to the action module?
In my case it would be auth:admin
ActionServiceProvider.php
Needs to be customizable
How is the route
If anyone comes across this issue, here is a hack to temporarily solve the issue:
Add this to your AppServiceProvider.php
and replace admin
with the name of your custom auth guard
app(Router::class)->middlewareGroup('filament.actions', ['web', 'auth:admin']);
@spcbfr Thanks!! This saved me, I have been looking for a way to override this.
Perhaps the routes to import csv should be within the panel routes, from what I saw the import routes do not take into account the context of which panel was requested
Imports and exports can be used outside of panels.
So it gets a little complex, there would have to be some way to change the middleware in the project itself.
In my project I solved it this way
Route::get('/filament/imports/{import}/failed-rows/download', DownloadImportFailureCsv::class) ->name('filament.imports.failed-rows.download') ->middleware('auth:consignante');
Package
filament/actions
Package Version
v3.2.76
Laravel Version
v11.7.0
Livewire Version
v3.4.12
PHP Version
PHP 8.3.0
Problem description
I'm using two panels with different guards.
When I'm importing and it fails, it always tries to find the user in the default guard. There should be an option to choose which guard the user should look for.
It tries to login in to the default guard
I think in this part of the code you should choose which guard to use
Expected behavior
When trying to download the file, it should not try to authenticate to a different guard than the one logged in
Steps to reproduce
Upload this file, in the resource car I put the date in an invalid format. And then try to download the failed file.
car-importer-example (1).csv
Reproduction repository
https://github.com/leonardyrj/filament-issue
Relevant log output
No response
Donate 💰 to fund this issue