문제

I use basic authentification for logged user in Laravel.

Route::get('profile', array('before' => 'auth.basic', function()
{
    if (Auth::check()){
        echo 'Logged';
    }else{
        echo 'Not logged';
    }
}));

Route::filter('auth.basic', function() {
    return Auth::basic();
});

If the user cancel the basic authentification i have a good message like "Invalid credentials."

If the user use valid pass/username then user is successfully authenticated.

However, if the pass/username is wrong i have this error :

Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must implement interface Illuminate\Auth\UserInterface, null given, called in /backend_rest/vendor/laravel/framework/src/Illuminate/Auth/Guard.php on line 316 and defined

The user is authenticated but as null ...

올바른 솔루션이 없습니다

다른 팁

Check your module, does it have this?

class Yourclass extends Eloquent implements UserInterface, RemindableInterface{

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top