deviseにてパスワードを忘れたメールのリンクが、production環境だと正しいurlになりません。
reset_password_instructions.html.erb
<p><%= link_to 'パスワードを再設定', edit_password_url(@resource, reset_password_token: @token) %></p>
のリンク先がdevelopment環境では正常に
localhost:3000/users/password/edit?reset_password_token
となりパスワードを再設定できます。
production環境では、
herokuapp/.../users/password/edit?reset_password_token
のようになって欲しいのですが
localhost:3000/users/password/edit?reset_password_token
のようにlocalhostにつながってしまいます。
development.rbにて
config.action_mailer.raise_delivery_errors = true config.action_mailer.default_url_options = { host: "******.herokuapp.com" } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => 'smtp.gmail.com', :port => 587, :domain => 'gmail.com', :user_name => '******@gmail.com', :password => '******', :authentication => :plain, :enable_starttls_auto => true }
としたのですがどのようにすれば、production環境にて正しいリンクに繋がるのでしょうか。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/23 21:19