Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentinel::login error #542

Open
arashsoltani opened this issue Nov 12, 2020 · 3 comments
Open

Sentinel::login error #542

arashsoltani opened this issue Nov 12, 2020 · 3 comments

Comments

@arashsoltani
Copy link

hi..
i have an issue in creating Login with Sentinel.
this code, works perfectly as the user has registered in the system. But, when it cant find the user, i get this error:

Argument 1 passed to Cartalyst\Sentinel\Sentinel::login() must implement interface Cartalyst\Sentinel\Users\UserInterface, bool given, called in C:\xampp\htdocs\portal\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 261

here is the code:

$user = Sentinel::authenticate($request->all()); if (Sentinel::check($user)){ Sentinel::login($user); return redirect('/'); } else{ return redirect()->back(); }

how should i fix this? thanks

@m33ts4k0z
Copy link

m33ts4k0z commented Nov 22, 2020

Change the code to this:

if($user = Sentinel::authenticate($request->only('email', 'password'))) {
 return redirect('/'); 
} else { 
return redirect()->back();
 }

@arashsoltani
Copy link
Author

thanks for your help

@hardcoding
Copy link

@arashsoltani
Is the status of this issue still correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants