Disallow Soft deleted User to login using Auth in laravel 4
I have a soft remote user and it worked fine. When I list the list of users, it doesn't show that the remote user means it works well. I also checked it in the database table. The deleted_at field is created when I softly delete it. The problem is when I login with credentials with soft remote users it allows me to. I don't want the kernel to delete the user to login. I am using Auth for authentication.
+3
source to share
1 answer
You can use the code given in the Laravel documentation where you would replace active => 1 with deleted_at => null
http://laravel.com/docs/4.2/security#authenticating-users
if (Auth::attempt(array('email' => $email, 'password' => $password, 'active' => 1)))
{
// The user is active, not suspended, and exists.
}
+2
source to share