This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
Middleware class with Gate functionality definable #114
Labels
enhancement
New feature or request
Feature
Feature request / feature being added via PR
good first issue
A good issue to get your feet wet
v5
version 5, supports both API and self hosted
Projects
Milestone
Description
It would be useful to have a middleware that is dedicated to the MailEclipse editor, instead of defining it in the controllers constructor. Currently if it is updated, you have to make sure it is updated in both controllers and also any future controllers.
It might not be clear to an end user where the actual auth logic is coming in.
Describe the solution you'd like
It would mean that there can be a definition in the middleware to check the environment setting as well as a custom Gate policy if the user defines it to limit the number of users who actually have access.
A user can then define a Gate policy in an extended ServiceProvider class that can be published with the stub of the policy in there.
Or the callback can be placed in via the
MailEclipse
facade. (Adjustment and improvement to this in future versions)The Middleware would be defined in the same pattern as a normal middleware. The logic for authentication is then moved from the controllers to a central place. The middleware would be defined in the config file e.g.:
\Qoraiche\MailEclipse\Http\Middleware\MailEclipse::class,
The text was updated successfully, but these errors were encountered: