开发者

confirmation_url points to localhost

开发者 https://www.devze.com 2023-02-03 11:03 出处:网络
I am using Devise and omniauth for authentication in my rails app. I have followed readme and put the following line in my production.rb :

I am using Devise and omniauth for authentication in my rails app. I have followed readme and put the following line in my production.rb :

config.action_mailer.default_url_options = { :host => 
'http://morning-autumn-487.heroku.com' } 

My mailer has the following c开发者_JAVA百科ode:

<%= link_to 'Confirm my account',confirmation_url(@user, :confirmation_token =>
@user.confirmation_token) %>

When I upload the app to heroku, the confirmation mail has the following link for registration in the email : http://127.0.0.1:3000/users/confirmation?confirmation_token=8TyGWQo6y... Is there a setting that governs this host name ?


Try with

config.action_mailer.default_url_options = { :host => 'morning-autumn-487.heroku.com' }


Ok the issue was that - in setup_mail.rb there was a string :

ActionMailer::Base.default_url_options[:host] pointing to localhost:3000

Thanks for all the help.

0

精彩评论

暂无评论...
验证码 换一张
取 消