Export download logs out with other auth guards and tenants

This route:-
filament/exports/{export}/download
filament/exports/{export}/download
Seems to only apply to the main admin panel. If i try to download an export on a tenant domain I get redirected to admin. I've tried adding a manual route like this but no luck. Can anyone help??
Route::domain('{tenant}.'.config('app.enduser_domain'))->group(function() {
Route::get('filament/exports/{export}/download', DownloadExport::class)->name('download.export');
});
Route::domain('{tenant}.'.config('app.enduser_domain'))->group(function() {
Route::get('filament/exports/{export}/download', DownloadExport::class)->name('download.export');
});
Solution:
I've found it, need to override the filament.actions middleware, just added this to the app service provider and it all works perfectly now. ```php Route::middlewareGroup('filament.actions', [ 'web', 'auth:admin,organisation,associate',...
Jump to solution
3 Replies
acroninja
acroninjaOP5w ago
Seems to work now by redeclaring the same filament route with the additional auth guards. I think by not specifying the domain it will apply to all.
Route::get('filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware('auth:admin,organisation,associate');
Route::get('filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware('auth:admin,organisation,associate');
Edit, this is NOT the solution. whilst it appeared to work - actually it's wrong. Looking at adding some custom middleware to override the filament.actions middleware which specifies web and auth which is the default guard only.
awcodes
awcodes5w ago
You shouldn’t need to define a specific route for this. As long as your subdomain is setup correctly in both the panel provider and your nginx config I would expect it all to work as expected. Sorry I don’t have an actual solution for you but my gut says you’re overcomplicating it.
Solution
acroninja
acroninja5w ago
I've found it, need to override the filament.actions middleware, just added this to the app service provider and it all works perfectly now.
Route::middlewareGroup('filament.actions', [
'web',
'auth:admin,organisation,associate',
]);
Route::middlewareGroup('filament.actions', [
'web',
'auth:admin,organisation,associate',
]);
Want results from more Discord servers?
Add your server