为什么密码在迁移后不在Symfony中匹配?
目前,我们将网站迁移到另一台服务器,但我们仍在使用相同的数据库。
因此,我们有2个确切的网站连接到1个数据库。
在第一个,我们可以使用Defaul凭据登录,而在另一个密码上,密码不匹配。
这是我们检查密码是否匹配的方式:
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
public function checkCredentials($password, UserInterface $user ){
return $this->passwordEncoder->isPasswordValid($user, $password );
}
这是我的安全配置:
security:
encoders:
App\Entity\User:
algorithm: auto
# ...
为了获得相同的密码,我需要使用一些哈希吗?
Currently we are migrating our website to another server, but we are still using the same database.
So we have 2 exact websites connected to 1 database.
On the first one we can log in with the defaul credentials, and on the other the passwords do not match.
This is how we check if the password matches:
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
public function checkCredentials($password, UserInterface $user ){
return $this->passwordEncoder->isPasswordValid($user, $password );
}
This is my security config:
security:
encoders:
App\Entity\User:
algorithm: auto
# ...
is there some hash that I have to use in order to obtain the same password?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论