-
Notifications
You must be signed in to change notification settings - Fork 193
Custom UserProvider extended NoDatabaseUserProvider #575
Comments
Hi @TwanoO67, thanks for bringing this up! Going to label this as a bug. I definitely want developers to be able to extend the providers. Going to fix this tonight! 😄 |
Fixed in v4.0.8. Thanks! |
Hi @stevebauman, I believe, I have the same but opposite problem as @TwanoO67 above. However there is a check here AdldapAuthServiceProvider for Perhaps there is another recommended approach to extending that user provider? Background: |
Hi @hartleypool, I think that using instanceof everywhere instead of comparing class should fix your issue. Furthermore,I dont know if it can help you with your problem, but there is some option in the original adldap package to specify the User model you want. So you don't need to override the user provider to change model class. |
@TwanoO67 Thanks. Yes, I had already changed the config It turned out to be fairly straightforward, so in case someone else comes across this. I'll document what worked below for creating a provider that overrides/extends In config/auth.php:
Make custom Provider : In config/adldap_auth.php: Edit new DoctrineDatabaseUserProvider.php
|
Description:
Hello! :)
I'm trying to create my own provider that extends NoDatabaseUserProvider.
But I can't because of this line:
Adldap2-Laravel/src/Resolvers/UserResolver.php
Line 74 in cc16faf
which is testing the class selected by string comparison.
So my provider even if it extend NoDatabaseUserProvider, is treated as DatabaseUserProvider.
Is it possible to replace that comparison by something using "instanceof" ?
Like in this class:
Adldap2-Laravel/src/Middleware/WindowsAuthenticate.php
Line 77 in 68deaba
That would be very usefull :)
Regards,
Antoine
The text was updated successfully, but these errors were encountered: