Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forgot Email give a "500 Internal Server Error" #84

Open
emgg-test opened this issue Jun 15, 2023 · 5 comments
Open

Forgot Email give a "500 Internal Server Error" #84

emgg-test opened this issue Jun 15, 2023 · 5 comments

Comments

@emgg-test
Copy link

When clicking on the Retrieve Error the page gives a "Internal Server Error"

Steps:

  1. At the home page select "Forgot Email"
  2. Enter an email address
  3. Click on "Retrieve Password"

Actual result:
The browser shows "Internal Server Error" having a 500 server error

Expected result:
The browser should be redirected to the page: https://the-internet.herokuapp.com/email_sent

@ms6073
Copy link

ms6073 commented May 8, 2024

FYI - this issue continues to persist!

@parmaryash-stack
Copy link

this is good answer.

@brownEFX
Copy link

Internal Server Error still persists. Please help

@ms6073
Copy link

ms6073 commented Jul 31, 2024

Internal Server Error still persists. Please help

Well based on the comment at the top of the email_sent.erb view file from 10-years ago, appears this has never worked! While I am not a ruby develper, if I had to make a guess, seems like there is an issue with the workflow starting at line 317 in server.rb

get '/forgot_password' do
    erb :forgot_password
  end

  set :email_username, ENV['SENDGRID_USERNAME'] || ''
  set :email_password, ENV['SENDGRID_PASSWORD'] || ''
  set :email_address, '[email protected]'
  set :email_service, ENV['EMAIL_SERVICE'] || 'gmail.com'
  set :email_domain, ENV['SENDGRID_DOMAIN'] || 'localhost.localdomain'

  post '/forgot_password' do
    require 'pony'
    Pony.mail(
      from:     "[email protected]",
      to:       params[:email],
      subject:  "Forgot Password from the-internet",
      body:     "A forgot password retrieval was initiated from http://the-internet.herokuapp.com/forgot_password to #{params[:email]}.

  If this were a real message, you would likely see a link or some relevant text that would help you retrieve a password.

  If you want to test login, visit http://the-internet.herokuapp.com/login and use the following credentials:

  username: tomsmith
  password: SuperSecretPassword!",
      via:      'smtp',
      via_options: {
        address:              'smtp.' + settings.email_service,
        port:                 '587',
        enable_starttls_auto: true,
        user_name:            settings.email_username,
        password:             settings.email_password,
        authentication:       :plain,
        domain:               settings.email_domain
      })

    redirect '/email_sent'
  end

  get '/email_sent' do
    erb :email_sent
  end

@harishyamAutomation
Copy link

Still facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants