Ruby on Rails: bad username / password? (535 Auth failed) -
i finished ruby foundations coursework @ bloc , i'm starting bury head rails development. things going smooth until hit snag devise , confirmation emails. tried googling , looking around @ other questions couldn't find gave me pull , apply situation.
i'm receiving following error when signing account.
net::smtpauthenticationerror in devise::registrationscontroller#create
535 authentication failed: bad username / password
error extracted source around line #976
def check_auth_response(res) unless res.success? raise smtpauthenticationerror, res.message end end
from other posts know you'll want see have config/initializers/setup_mail.rb file looks this:
if rails.env.development? actionmailer::base.delivery_method = :smtp actionmailer::base.smtp_settings = { address: 'smtp.sendgrid.net', port: '587', authentication: :plain, user_name: env['sendgrid_username'], password: env['sendgrid_password'], domain: 'heroku.com', enable_starttls_auto: true } end
and here's application.yml file example:
sendgrid_password: sendgrid_username: secret_key_base:
also have following in config/environments/development.rb before suggests it:
config.action_mailer.default_url_options = { host: 'localhost:3000'} config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true # override action mailer's 'silent errors' in development config.action_mailer.raise_delivery_errors = true
if there's other files you'd see let me know , i'll add them post.
congrats , welcome world of hacking on cool things.
the error getting means sendgrid server received bad username + password combo.
chances environment variables empty , application.yml
file isn't being loaded sendgrid username + password.
you can confirm printing them out somewhere in code. in controller works.
puts "sendgrid_username: #{env['sendgrid_username']}" puts "sendgrid_password: #{env['sendgrid_password']}"
i'd suspect nil.
i'd recommend reading https://quickleft.com/blog/simple-rails-app-configuration-settings/ how them sourced app.
please let me know if need more help!
Comments
Post a Comment