filament-authentication icon indicating copy to clipboard operation
filament-authentication copied to clipboard

Avoid registering middlewares and routes if feature is disabled and add opt-out

Open xDefcon opened this issue 1 year ago • 2 comments

If a specific feature is disabled from the config file, there's no reason to load specific middlewares and routes.

I am referring to:

  1. ImpersonatingMiddleware
  2. RenewPasswordMiddleware

https://github.com/phpsa/filament-authentication/blob/d32ce3624a90532c8b4a0407766a62ba6f4afded/src/FilamentAuthentication.php#L58

And for the routes:

https://github.com/phpsa/filament-authentication/blob/d32ce3624a90532c8b4a0407766a62ba6f4afded/routes/web.php#L8

It would be also cool to have the option to disable from the config file the password_renewal feature. If disabled, the specific route and middleware should not be loaded in the application.

Would you accept a PR having those modifications? Do you see any issues in implementing those features?

Thank you 👍

xDefcon avatar May 17 '24 20:05 xDefcon

PRs sre always welcome as are requests / bug reports, so thanks.

If you csn put in a pul request i will look at it, else will look at it myself in a few days,

phpsa avatar May 17 '24 21:05 phpsa

@xDefcon -- initial work on this: https://github.com/phpsa/filament-authentication/releases/tag/v4.3.0-beta.1

phpsa avatar May 21 '24 08:05 phpsa