ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

Driver [imap] not supported. #97

Closed chriscarpenter12 closed 9 years ago

chriscarpenter12 commented 9 years ago

I am running into this "Driver not supported" issue others have stated and I can't figure out why my custom auth driver will no load. It worked before testing multiauth. I replaced my AuthServiceProvider with "Ollieread\Multiauth\MultiauthServiceProvider" as stated in the readme and I am using Ollieread\Multiauth\Guard in my Auth::extend

Auth::extend('imap', function($app) {
  $provider = new \Project\Providers\ImapUserProvider($custom_parameters_here);
  return new \Ollieread\Multiauth\Guard($provider, $app['session.store']);
});

auth.php

'multi' => array(
    'admin' => array(
      'driver' => 'eloquent',
      'model' => 'Admin',
      'table' => 'admins'
    ),
    'user' => array(
      'driver' => 'imap',
      'model' => 'User',
    )
),

My driver name and Auth::extend both have the same name as another issue indicated, but its just not working...

chriscarpenter12 commented 9 years ago

Git it figured out didn't read the last issue well enough.

Auth::user()->extend is what I needed.