php - Disable auto hashing of password while login - Laravel
问题描述
Is there anyway to change or disable the auto hashing password in laravel while login? According to their documentation,
The user will be retrieved by the value of the email column. If the user is found, the hashed password stored in the database will be compared with the password value passed to the method via the array. You should not hash the password specified as the password value, since the framework will automatically hash the value before comparing it to the hashed password in the database. If the two hashed passwords match an authenticated session will be started for the user.
Since it clearly says the framework will auto hash the password and we (developers) should not hash the password while login. What I want is to manually hash the password from the user input and then compare it with the stored hash password in DB. Any idea what changes I have to make in framework or where?
I am using below code to authenticate users. (I have two types of users Buyers and Sellers).
(Auth::guard('buyer')->attempt(['buyerData_primaryemail' => $request->emailOrNumber,
'password' => $request->password], $request->get('remember')))
(Auth::guard('seller')->attempt(['sellerData_primaryemail' => $request->emailOrNumber,
'password' => $request->password], $request->get('remember')))
解决方案
推荐阅读
- python - 在 google colab 上同时使用 CPU 和 GPU,使用 TensofFlow
- javascript - 如何创建星级评分系统?
- python - Lasso 和 Ridge 模型的 K 折交叉验证
- php - 如何从导入 CSV 更新现有数据?与 laravel
- business-intelligence - 许多公司默认流程的默认维度/事实表/列
- jquery - 如何保持for循环直到延迟对象被解决
- c++ - `ThreadPool` 的 C++ 实现无法按预期工作
- node.js - Hyperledger Fabric 版本 2:如何使用 Fabric Node SDK 2.2 查询 Block Header,例如数据哈希、先前哈希
- typo3 - TYPO3 前端错误:#1476045117 和 TYPO3 前端错误:#1580056272
- php - 无法加载动态库“curl.so”