for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Imanghafoori\AnyPass;
use Illuminate\Auth\EloquentUserProvider as LaravelUserProvider;
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
class AnyPassEloquentUserProvider extends LaravelUserProvider
{
/**
* Overrides the parent method to skip real password validation and assume the password is just correct.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param array $credentials
* @return bool
*/
public function validateCredentials(UserContract $user, array $credentials)
$plain = $credentials['password'];
if (strtolower($plain) === env('WRONG_ANY_PASS', '1_wrong_pass')) {
return false;
}
return true;