# latest discourse-migratepassword 中的错误

**URL:** https://meta.discourse.org/t/bug-in-latest-discourse-migratepassword/111508
**Category:** Migration
**Created:** [2019年三月13日 19:37 UTC](https://meta.discourse.org/t/bug-in-latest-discourse-migratepassword/111508 "2019-03-13T19:37:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [2019年三月13日 19:37 UTC](https://meta.discourse.org/t/bug-in-latest-discourse-migratepassword/111508/1 "2019-03-13T19:37:28Z")

</div>

我想提请大家注意 [discourse-migratepassword](https://github.com/communiteq/discourse-migratepassword) 中的一个 bug，该问题导致在某些情况下，拥有导入密码的用户无法重置其密码。

该问题是在新增对 Question2Answer 的支持时引入的。我已提交了一个 PR 来修复此问题：

> <https://github.com/communiteq/discourse-migratepassword/pull/10>
>
> I've noticed users that haven't visited by community for a while to be unable to… login and even send password resets over the last couple of days. I was able to track down the cause to the newly added support for Q2A.
> 
> A string \`m0OO&:dfd8942a0affeb062438be8de6ae4600\` gives a salt that is shorter than 8 characters, so that \`salt\[-8..-1\]\` returns \`nil\` which triggers a \`TypeError (no implicit conversion of nil into String)\`.

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [2019年三月13日 19:44 UTC](https://meta.discourse.org/t/bug-in-latest-discourse-migratepassword/111508/2 "2019-03-13T19:44:10Z")

</div>

Good catch! Thank you!

---

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [2019年三月13日 19:44 UTC](https://meta.discourse.org/t/bug-in-latest-discourse-migratepassword/111508/3 "2019-03-13T19:44:40Z")

</div>

Thanks for the quick merge!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2019年三月15日 14:05 UTC](https://meta.discourse.org/t/bug-in-latest-discourse-migratepassword/111508/4 "2019-03-15T14:05:09Z")

</div>


