openstax / accounts

OpenStax centralized authentication and accounts service

Home Page:https://accounts.openstax.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid email address in forgot password request

jpslav opened this issue · comments

When users input a bad password on the forgot password screen we get:

An AWS::SES::ResponseError occurred in identities#forgot_password:

  InvalidParameterValue - Local address contains control or whitespace
  vendor/bundle/ruby/1.9.1/gems/aws-ses-0.6.0/lib/aws/ses/base.rb:175:in `request'

I'd recommend wrapping this code in a begin rescue block making sure to check that the rescued AWS::SES::ResponseError has the message above (as other errors we might need to bubble out as exceptions). When this specific error is caught, fatal_error with a decent message. Hopefully these messages already bubble up as flash errors to the user. Add a spec in /spec/features/forgot_password_spec.rb, making sure to mock the deliver call so that it raises this exception.

I recommend merging #252 and #254 first and seeing if this still happens.

I'm too much in bug search and destroy mode to have remembered that @karenc already knocked these out!