Ask Your Question
0

How can the issue of Devise not displaying an error indicating that the user does not exist in Heroku be resolved for the forgotten password feature?

asked 2023-05-25 02:19:38 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-25 02:45:01 +0000

djk gravatar image

There are several potential solutions to this issue:

  1. Configure Devise to display custom error messages when a user does not exist. This can be done by overriding the default Devise error messages in the config/locales/devise.en.yml file. For example:
en:
  errors:
    messages:
      user_not_found: "Sorry, we could not find a user with that email address."
  1. Check that the email address entered by the user is valid and exists in the database before triggering the password reset email. This can be done by adding custom validation to the User model or by using a gem like email_validator.

  2. Confirm that the email is actually sending by checking the logs in Heroku. If the email is not being sent, there may be an issue with the SMTP configuration in the config/environments/production.rb file.

  3. Check that the user is actually being redirected to the correct passwords/new page when the reset password link is clicked. If the redirect is not working correctly, the user may end up on a different page that does not display the error message.

  4. Update the versions of Devise and the dependent gems to the latest stable versions. This can be done by updating the Gemfile and running bundle update.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-25 02:19:38 +0000

Seen: 11 times

Last updated: May 25 '23