-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The "web" guard should be a configuration #20
Comments
Yes, something like this |
@mbougarne does this help in having a 2nd guard by setting |
IMO it should not be an Airlock configuration, but an configuration to the Airlock guard. By example, in the The problem is that the "airlock" driver is not a "full Guard", but an extension of the So in order to be able to configure the Airlock guard, and even to allow multiple guards of the Airlock driver, it would need a refactoring in And on that note, setting up Airlock to use "configuration by guard" instead of "configuration in airlock.php" would (at least in my mind) require a lot of other changes like, one example, also removing the That is kinda why this is an issue and not a direct PR on my part, I don't want to assume what Airlock aims to be (a simple authentication solution or a full flexible one) The one thing I'm certain is that this line https://github.com/laravel/airlock/blob/master/src/AirlockServiceProvider.php#L24 can be removed with the current state. Airlock is not using a provider for itself, and even the Laravel Docs example for Request Guard has a configuration without a provider |
Airlock is meant for SPA's and apis and not meant for web based apps. If you need authentication for web based apps, consider using Passport: https://github.com/laravel/passport |
@driesvints Passport also doesn't support multi |
@mansouralex right, sorry I misread this. |
This comment has been minimized.
This comment has been minimized.
The way I'm solving it now is to define a guard_map config that maps specified route patterns to the appropriate guards. Then in guards.php I fetch the appropriate guard based on the request path. Seems to work for spa but don't know how it affects tokens. |
Also using multiple guards would really like to see 'web' guard as a config option. |
Pr was merged and will be in the next release |
Taylor removed the config a day later, but kept the functionality there, I guess it's not certain this feature will remain or how it will be implemented, for now I am setting the sanctum.guard value in the route service provider. |
The cookies are handled by the
SessionGuard
, and you can have many as you want. I think most cases will be like me where we have one Guard for aUserProvider
and a second Guard for a differentUserProvider
(like tableusers
andcustomers
).Anyways, I think this value should not be hardcoded:
https://github.com/laravel/airlock/blob/master/src/Guard.php#L46
https://github.com/laravel/airlock/blob/master/src/Guard.php#L77
The text was updated successfully, but these errors were encountered: