ERR_CONNECTION_REFUSEDのエラー

sorcery gemのパスワードリセット機能を実装中に下記エラーになってしまいました。

letter_opener_web gemでメールの内容を確認しています。
コードは、以下のようになります。

class PasswordResetsController < ApplicationController # In Rails 5 and above, this will raise an error if # before_action :require_login # is not declared in your ApplicationController. # request password reset. # you get here when the user entered their email in the reset password form and submitted it. def new; end def create @user = User.find_by(email: params[:email]) # This line sends an email to the user with instructions on how to reset their password (a url with a random token) @user.deliver_reset_password_instructions! if @user # Tell the user instructions have been sent whether or not email was found. # This is to not leak information to attackers about which emails exist in the system. redirect_to login_path end # This is the reset password form. def edit @token = params[:id] @user = User.load_from_reset_password_token(@token) if @user.blank? not_authenticated return end end # This action fires when the user has sent the reset password form. def update @token = params[:id] @user = User.load_from_reset_password_token(params[:id]) if @user.blank? not_authenticated return end # the next line makes the password confirmation validation work @user.password_confirmation = params[:user][:password_confirmation] # the next line clears the temporary token and updates the password if @user.change_password(params[:user][:password]) redirect_to(root_path, :notice => 'Password was successfully updated.') else render :action => "edit" end end end

PasswordResetsControllerのcreateアクションは実行され、以下のようにメールが確認できます。

Image from Gyazo

メール本文をコピーしてリロードすると以下のようになります。

Image from Gyazo

ルーティング設定は、以下のようになっているので、ルーティングの問題では無いと考えています。

edit_password_reset GET /password_resets/:id/edit(.:format) password_resets#edit

参考記事を参照に試したことは、以下の項目になります。
・ルーターを違うものに変えた
・違うサイトを検索すると他のサイトは、普通に表示されます。
・ブラウザの種類を変えましたが、同じように表示されます。
・DNSキャッシュを削除する
・ブラウザのキャッシュを削除する

解消方法や原因が分からず詰まってしまいました。
ご教示お願いできればと思います。

参考記事

https://aprico-media.com/posts/3780

コメントを投稿

0 コメント