-
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
Remove the facade aliases usage since they can be removed/changed fro… #215
Remove the facade aliases usage since they can be removed/changed fro… #215
Conversation
…m the Laravel configuration which will make impossible to install and use the plugin.
@@ -37,7 +37,7 @@ public function getUserByUserInfo(array $userInfo) : Authenticatable | |||
public function getUserByIdentifier($identifier) : ?Authenticatable | |||
{ | |||
// Get the user info of the user logged in (probably in session) | |||
$user = \App::make('auth0')->getUser(); | |||
$user = \Illuminate\Support\Facades\App::make('auth0')->getUser(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be throwing an error with our tests. Any ideas on how to work around this?
@@ -21,11 +21,11 @@ class LoginServiceProvider extends ServiceProvider | |||
*/ | |||
public function boot() | |||
{ | |||
\Auth::provider('auth0', function ($app, array $config) { | |||
\Illuminate\Support\Facades\Auth::provider('auth0', function ($app, array $config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to import these with use
statements at the top of the file as opposed to going the inline route? Not sure if this was a technical requirement, just curious if that would be a cleaner approach otherwise.
Hey, @Rezouce! 👋 Thanks for your PR — I think this is a reasonable suggestion. I've left a few comments. |
…oid having the full classname.
…we're not using the alias anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks excellent, thanks for your contribution on this! I'll merge it in for the next release.
Changes
Use the fully qualified facade class names instead of their aliases which allow using the plugin even when for some reason the default aliases have been removed or replaced (ie. legacy code usage).
Testing
[x] This change has been tested on the latest version Laravel
Checklist
[x] I have read the Auth0 general contribution guidelines
[x] I have read the Auth0 Code of Conduct