为什么密码在迁移后不在Symfony中匹配?

发布于 2025-02-02 03:24:41 字数 539 浏览 4 评论 0原文

目前,我们将网站迁移到另一台服务器,但我们仍在使用相同的数据库。

因此,我们有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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文