php - Symfony PHP 文档“如何创建自定义表单密码验证器”中的错误
问题描述
我在文档中发现了 2 个问题。你能告诉我这对你来说是否也有问题吗?在页面https://symfony.com/doc/3.4/security/custom_password_authenticator.html 第 43 行:
if (!$this->encoder->isPasswordValid($user->getPassword(), $givenPassword, $user->getSalt())) {
throw new BadCredentialsException('The given password is invalid.');
}
代替:
if (!$this->encoder->isPasswordValid($user, $givenPassword, $user->getSalt())) {
throw new BadCredentialsException('The given password is invalid.');
}
第 48 行
if ($isPasswordValid) {
*$isPasswordValid* is empty
}
解决方案
推荐阅读
- c++ - 带有柯南的 CMake 找不到 assimp-vc142-mt.lib
- python - 是否有更快的方法来获取基于线性回归模型的值并将其附加到 DataFrame 中的新列?
- pandas - 如何将 pandas._libs.tslibs.timestamps.Timestamp 列表转换为 datetime.datetime?
- c# - 缺少 Visual Studio C# 中引用的程序集选项
- reactjs - 来自共享库的 Nextjs 样式在初始加载时未加载
- python - 如何从两侧找到最大数组
- json - 如何从 Angular http 服务中的 JSON 对象数组返回特定字段作为响应
- image - golang 在 Python PIL 中没有相同的 tobytes() 方法吗
- angular - 不是 Angular 中的函数错误(ag-grid)
- python - 如何在 Discord.py 中使用斜线菜单