-
Notifications
You must be signed in to change notification settings - Fork 136
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
Extend Illuminate\Foundation\Auth\User #104
Comments
Thanks for the note here @dustinleblanc ... we have a section on our quickstart that addresses Auth0 login along with a database: https://auth0.com/docs/quickstart/webapp/laravel#extra-custom-user-handling Is that helpful or are you looking to do something else? |
Hey @joshcanhelp ! That documentation was helpful during implementation, I've just run into a limitation running that setup. I can load my user from the database, and access all the data we define for the user in the database tables, or I can instead load the user using's Auth0's provided classes and get the Auth0 metadata for the user, but at the current time I can't really see how to load both sets of data on a single object. I'd like to have my user model extend the This isn't a deal breaker btw, more of an improvement. We currently have the app on Laravel 5.2 if that matters. Thanks! |
What, exactly, are you trying to do that you're unable to? Would it be possible to extend the Eloquent model to extract that user data, using the Auth0 class as an example? I'm definitely open to a different implementation here, as long as it doesn't mean we break everything! |
No activity, closing. |
I don't know if this ticket should be re-opened but two use-cases include issue #114 and integrating with bouncer (https://github.com/JosephSilber/bouncer) Apologies if necroing this thread is incorrect etiquette. |
@vomitHatSteve - "necroing" is my favorite word of the month now, thank you for that 😆 Happy to re-open this. We're working on a major in the 7.0.0 branch (not a lot there currently) and I'm guessing the changes required to get this working how it should will include some breakage. I'm happy to take a first pass at this once we've got our SDK major released and working in the 7.0.0 branch here but open to PRs and suggestions in the meantime! |
Hi @joshcanhelp , @lbalmaceda just wanted to put a brief note here as well for the internal eng. issue. I was able to reproduce the issue using this repository. Let me know if I can with anything else. |
@vomitHatSteve @saltukalakus - Would you be able to give the https://github.com/auth0/laravel-auth0/tree/change-user-model |
This branch doesn't appear to introduce new issues for me, but I'm still stymied by #158 unfortunately. |
I'm running into issues as well and I'm not skilled enough yet to fully understand it. I believe its that the user provider is not extending the native model? So I can't do something like: Auth::guard(app('VoyagerGuard'))->getProvider()->getModel(); Its making it difficult to use some of these open source packages |
@rlewkowicz - Does this branch solve your issue? https://github.com/auth0/laravel-auth0/tree/change-user-model Requires PHP 7.1, FYI. |
We took a different approach here based on feedback. Please see the draft PR below to see what we're proposing: That new trait can be added to the Eloquent User model which can be returned from a custom User repository. If anyone has feedback on this, we'd appreciate it! |
Closing this ticket as it's quite stale at this point, but the next major of this Laravel plugin will include a refactored user model that will address this, based on the work in the PR Josh linked above |
I've found that I am having to handle Auth0 user data and my database models separately which isn't very convenient. Using Eloquent's
User::firstOrNew()
isn't possible usingAuth0User
, but if decide to extend my user object from the default Eloquent object, I lose access to the added Auth0 data, I'd love to have peanut butter and chocolate 😄The text was updated successfully, but these errors were encountered: