インポートしたユーザーで dev インスタンスにログインできない

IPB からローカルの Discourse 2.0.0.beta2 へ最初のユーザーをインポートし、さらに @michaeld さんの discourse-migratepassword を使って以前のパスワードもインポートしました。

すべては正常に動作しているようです。ユーザーはデータベースに存在し、discourse-migratepassword 内のパスワードチェックも成功することを確認しました。

問題なのは、生パスワードを設定した後のユーザー保存が失敗する点です。User.savefalse を返し、confirm_password? が失敗し、ログに以下の出力を生成します。

I, [2018-02-01T14:31:42.198999 #58525]  INFO -- : Started POST "/session" for ::1 at 2018-02-01 14:31:42 +0100
I, [2018-02-01T14:31:42.303772 #58525]  INFO -- : Processing by SessionController#create as */*
I, [2018-02-01T14:31:42.305979 #58525]  INFO -- :   Parameters: {"login"=>"Florian", "password"=>"[FILTERED]"}
D, [2018-02-01T14:31:42.314922 #58525] DEBUG -- :   User Load (2.3ms)  SELECT  "users".* FROM "users" WHERE "users"."username_lower" = 'florian' LIMIT 1
D, [2018-02-01T14:31:42.379916 #58525] DEBUG -- :    (1.0ms)  SELECT "user_custom_fields"."name", "user_custom_fields"."value" FROM "user_custom_fields" WHERE "user_custom_fields"."user_id" = 1 ORDER BY id asc
D, [2018-02-01T14:31:42.383404 #58525] DEBUG -- :    (0.6ms)  BEGIN
D, [2018-02-01T14:31:42.400523 #58525] DEBUG -- :   UserEmail Load (2.0ms)  SELECT  "user_emails".* FROM "user_emails" WHERE "user_emails"."user_id" = 1 AND "user_emails"."primary" = 't' LIMIT 1
D, [2018-02-01T14:31:42.427949 #58525] DEBUG -- :   UserEmail Exists (2.8ms)  SELECT  1 AS one FROM "user_emails" WHERE "user_emails"."email" = 'address@domain.invalid' AND ("user_emails"."id" != 1) LIMIT 1
D, [2018-02-01T14:31:42.433311 #58525] DEBUG -- :   UserEmail Exists (1.5ms)  SELECT  1 AS one FROM "user_emails" WHERE "user_emails"."primary" = 't' AND ("user_emails"."id" != 1) AND "user_emails"."user_id" = 1 LIMIT 1
D, [2018-02-01T14:31:42.437460 #58525] DEBUG -- :    (1.1ms)  ROLLBACK
I, [2018-02-01T14:31:42.442319 #58525]  INFO -- : Completed 200 OK in 134ms (Views: 0.2ms | ActiveRecord: 25.3ms)

Ruby や Rails/ActiveRecord は初めて触れるものです。私の説明から何か手がかりが見つかれば幸いです :slight_smile:

よろしくお願いします!
—Florian

The plugin works great, so the number one reason for login issues is usually password related:

Thanks a lot — exactly the reason why it wasn’t working!

The plugin now features the setting migratepassword_allow_insecure_passwords which enables you to work around this issue.

Thanks for adding that setting.

Ideally the plugin would prompt the user to change the password when an insecure password is detected.

Yeah, allowing the login but setting the login redirect to /my/preferences/account?needs_password_reset would probably solve the problem.