首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FOS用户捆绑包:更改密码期间,列'salt‘不能为空

FOS用户捆绑包:更改密码期间,列'salt‘不能为空
EN

Stack Overflow用户
提问于 2018-08-23 18:46:38
回答 1查看 404关注 0票数 0

此前,该应用程序的版本为PHP7.0、SF 3.1和FOS/UserBundle 2.0。

在使用SF 3.4和FOS/UserBundle 2.1迁移到PHP7.2之后,在更改密码期间,我遇到了以下情况:

代码语言:javascript
复制
$ bin/console fos:user:change-password toto pass1234

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null" ["exception" => Doctrine\DBAL\Exception\NotNullConstraintViolationException { …},"command" => "fos:user:change-password toto pass1234","message" => """  An exception occurred while executing 'UPDATE fos_user SET salt = ?, password = ? WHERE id = ?' with params [null, "$2y$13$LOb\/************************************wof0QpTGGpzGi", 2]:\n  \n  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null  """] []

In AbstractMySQLDriver.php line 123:

  An exception occurred while executing 'UPDATE fos_user SET salt = ?, password = ? WHERE id = ?' with params [null, "$2y$13$LOb\/************************************wof0QpTGGpzGi", 2]:                                            

  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null                                                                      


In PDOStatement.php line 144:

  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null                                                                      


In PDOStatement.php line 142:

  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null                                                                      


fos:user:change-password [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> <username> <password>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-23 18:51:22

解决了!

我编辑了文件app/config/security.yml,并将security.encoders.FOS\UserBundle\Model\UserInterface的值(即bcrypt)替换为argon2i

然后我清除了缓存,重试了一次,这起作用了!

https://symfony.com/doc/current/reference/configuration/security.html#reference-security-argon2i

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51984009

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档