black-bits / laravel-cognito-auth

MIT License
89 stars 51 forks source link

Using an unregistered email in the Reset Password from leads to ErrorException #46

Closed waqleh closed 2 years ago

waqleh commented 2 years ago

Using an unregistered email in the Reset Password from leads to ErrorException

steps to reproduce:

  1. Go to Reset Password form (/password-reset)
  2. Fill Email Address field with a valid but unregistered email
  3. Fill the rest of the form correctly
  4. Submit Reset Password form

Result:

ErrorException Trying to access array offset on value of type bool

Illuminate\Foundation\Bootstrap\HandleExceptions::handleError vendor/black-bits/laravel-cognito-auth/src/Auth/ResetsPasswords.php:28

if ($user['UserStatus'] == CognitoClient::FORCE_PASSWORD_STATUS) {

the solution in this commit was tested and it works as expected

waqleh commented 2 years ago

@oheck can you please approve this and create a new tag so i can use it with composer