ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

Auth check() not working? after attempt It always returns true #79

Closed msonowal closed 8 years ago

msonowal commented 9 years ago

My Login Function Implementation On AdminController()

public function doLogin()
{
    $remember = (Input::has('remember_me')) ? true : false;
    Auth::admin()->attempt(array(
        'username' => Input::get('username'),
         'password' => Input::get('password')
    ), $remember);

    if(Auth::admin()->check()) {
        return Redirect::intended('/'); //It is always returning true so it is redirecting 
    } else {
        return Redirect::back()->withErrors(['Either Username or Password is Incorrect!']);*/
    }
}

and This is my filter

Route::filter('auth.admin', function()
{   
    (Auth::admin()->guest())
    return View::make('admins.login')->with('message', 'Please login using your credentials');*/
});

Please fix my issue I love your plugin because of multi table based authentication but I am stuckked while implementing. PLease help

ollieread commented 9 years ago

I think your filter code is broke, why are you checking for guest()?

msonowal commented 9 years ago

by the way thanks for the late reply, YOur plugin really helped me and I fixed that out One more issue was password reset CAn please fix it or upload a example of using password reset on multi auth thank you

ollieread commented 9 years ago

Password reset isn't broken, and I can't suggest anything if you don't tell me what's wrong.

msonowal commented 9 years ago

OK If it's well then can you show me or link me to some examples of Password reset Controller route and the view , please thanks in advance..

InfiniteDevelopment commented 8 years ago

I can confirm this does not work... Unable to use ->check()

ollieread commented 8 years ago

Check always returns true? Also, what version, this package and laravel.