Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

「Reset password tokenは不正な値です。」と表示されてパスワードをリセットできない #1262

Closed
1 task done
orangain opened this issue Mar 13, 2017 · 1 comment
Milestone

Comments

@orangain
Copy link

orangain commented Mar 13, 2017

デモサーバーと手元で1.2.0を新規インストールした環境の両方で再現しました。

再現手順

  1. admin or enjuadminでログインして新しいユーザー(メールアドレスあり)を作成する
  2. ログアウトする
  3. ログイン画面の「パスワードを忘れましたか?」からメールアドレスを入力する
  4. 届いたメールの「Change my password」のリンクをクリックする
  5. パスワードリセットフォームが表示されるので、新しいパスワードを2回入力する
  6. 「Reset password tokenは不正な値です。」と表示されてパスワードをリセットできない

2017-03-13 21 07 26

原因?

メッセージでGoogle検索したところ、Devise 3.1.0以降ではメールテンプレートの変更が必要という情報が見つかりました。

Rails 4 + Devise: Password Reset is always giving a "Token is invalid" error on the production server, but works fine locally. - Stack Overflow
http://stackoverflow.com/questions/19018657/rails-4-devise-password-reset-is-always-giving-a-token-is-invalid-error-on

該当の箇所を見ると、確かに以下のように古い形式になっていました。

edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)

試しに手元で以下のように書き換えてみたところ、正常にパスワードをリセットできました。おそらく同じディレクトリの他の2つのファイルも変更が必要かと思います。

edit_password_url(@resource, :reset_password_token => @token)
@masao masao added the bug label Mar 13, 2017
@masao masao added this to the 1.2.x milestone Mar 13, 2017
orangain added a commit to orangain/docker-enju-leaf that referenced this issue Mar 13, 2017
nabeta added a commit that referenced this issue Apr 30, 2017
@masao masao modified the milestones: 1.2.2, 1.2.x Jun 4, 2017
@masao masao added the checking label Jul 2, 2017
@yegusa
Copy link

yegusa commented Jan 7, 2018

デモサーバーで確認しました。

できるようになっていましたので、クローズします。

image

enju_biblio: 0.2.3
enju_bookmark: 0.2.1
enju_circulation: 0.2.3
enju_event: 0.2.1
enju_leaf: 1.2.2
enju_library: 0.2.3
enju_manifestation_viewer: 0.2.1
enju_message: 0.2.2
enju_ndl: 0.2.3
enju_purchase_request: 0.2.0
enju_seed: 0.2.2
enju_subject: 0.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants