ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

auth filter always returns true for guest() #83

Closed brazenvoid closed 9 years ago

brazenvoid commented 9 years ago

I have the following filters;

Route::filter('auth.biz', function () {
    if (Auth::biz()->guest())
        return Redirect::route('auth.marketer.login');
});

Route::filter('auth.back', function () {
    if (Auth::back()->guest())
        return Redirect::route('auth.back.login');
});

Configuration;

    'multi' => array(
        'back' => array(
            'driver' => 'eloquent',
            'model' => 'BackUser'
        ),
        'biz' => array(
            'driver' => 'eloquent',
            'model' => 'BizUser'
        ),
        'user' => array(
            'driver' => 'eloquent',
            'model' => 'User'
        )
    ),

    'reminder' => array(
        'email' => 'marketer.emails.resetPassword',
        'table' => 'password_reminders',
        'expire' => 60,
    ),

Both endpoints have separate login pages and they correctly authenticate validated users. Reminders also work correctly. Only Auth doesn't retain its state beyond the login pages. All routes for authenticated users, even those from login page get invalidated.