Skip to content
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

Added the Auth0Service as a singleton through the classname #107

Merged
merged 1 commit into from
Nov 27, 2018

Conversation

JCombee
Copy link
Contributor

@JCombee JCombee commented Oct 13, 2018

Since the Auth0Service is registered under the name auth0 in the app container it doesn't load the instance when you use it in a constructor, since it is used in the authentication provider like this:

<?php

// ...

/**
 * Service that provides an Auth0\LaravelAuth0\Auth0User stored in the session. This User provider
 * should be used when you don't want to persist the entity.
 */
class Auth0UserProvider implements UserProvider
{
    protected $userRepository;
    protected $auth0;

    /**
     * Auth0UserProvider constructor.
     *
     * @param Auth0UserRepository       $userRepository
     * @param \Auth0\Login\Auth0Service $auth0
     */
    public function __construct(Auth0UserRepository $userRepository, Auth0Service $auth0)
    {
        $this->userRepository = $userRepository;
        $this->auth0 = $auth0;
    }

    // ...

}

#Hacktoberfest

Closes #103

@joshcanhelp
Copy link
Contributor

Thank you @JCombee! I'll test this out first thing next week and merge this in.

@joshcanhelp
Copy link
Contributor

@JCombee - I just realized that this is being based against the wrong branch. Can you switch to master?

Otherwise, this looks good and works on my end 👍

@joshcanhelp joshcanhelp changed the base branch from 5.x.x-dev to master November 27, 2018 00:03
@joshcanhelp joshcanhelp merged commit 0464bb0 into auth0:master Nov 27, 2018
@joshcanhelp joshcanhelp added this to the v5-Next milestone Apr 10, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants