CustomerUserProvider.php 561 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Auth;
  3. use App\Support\Magento1Password;
  4. use Illuminate\Auth\EloquentUserProvider;
  5. use Illuminate\Contracts\Auth\Authenticatable as UserContract;
  6. class CustomerUserProvider extends EloquentUserProvider
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function validateCredentials(UserContract $user, array $credentials): bool
  12. {
  13. $plain = $credentials['password'] ?? null;
  14. if (! is_string($plain) || $plain === '') {
  15. return false;
  16. }
  17. return Magento1Password::attempt($user, $plain);
  18. }
  19. }