Вопрос

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