ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

Using multiauth with tappleby/laravel-auth-token #62

Closed Ilyes512 closed 9 years ago

Ilyes512 commented 9 years ago

Does anyone got multiauth working with tappleby/laravel-auth-token. I am not sure what is going wrong? Should this work out of the box or are there any other steps I need to perform before this is going to work?

* (I did fallow all the instructions from the readme for installation. The token login did work before using multiauth).

I got the following multi auth types in my app/config/auth.php:

    'multi' => array(
        'user' => array(
            'driver' => 'eloquent',
            'model' => 'User'
        ),
        'portal' => array(
            'driver' => 'eloquent',
            'model' => 'PortalUser'
        ),
    ),

The user's that also need to login trough a token are the "user"'s (so not the "portal" users both the other one).

The error I get is as fallowed:

{  
   "error":{  
      "type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException",
      "message":"Call to a member function getProvider() on a non-object",
      "file":"\/home\/vagrant\/projects\/mywebsite.com\/vendor\/tappleby\/laravel-auth-token\/src\/Tappleby\/AuthToken\/AuthTokenManager.php",
      "line":17
   }
}

If anyone needs some more info or knows what I need to do to solve this, then please let me know. Tnx!

ollieread commented 9 years ago

If the other package utilises Auth, then it won't understand the factory modifications that multiauth works.