Laravel 5.4:密码重置令牌与电子邮件令牌不同 [英] Laravel 5.4: Password reset token not the same as email token

查看:102
本文介绍了Laravel 5.4:密码重置令牌与电子邮件令牌不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到laravel 5.4后我有一个小问题

I have a slight problem after upgrading to laravel 5.4

当我重设密码时,电子邮件会完美生成并发送,但是将其保存到数据库中用户记录的令牌如下:

When i do a password reset, the email gets generated and sent perfectly, however the token it saves to the user record in the database is as follows:

$2y$10$N0WFuqEkEIFto.CazxYLdOUmY1X9tBHfvDn8iWKUdlq2W9uOc00Ku

但是它发送给用户以进行密码重置的令牌是:

But the token it sends to the user to do a password reset is:

bc1c82830bc8ad1356aa5e2a2a5a342ae6c6fabd385add503795cca1a1993e15

我的问题是两个令牌为何不同.以及现在如何执行检查以验证令牌是否存在于数据库中,因为我需要获取要发送到重置控制器的电子邮件地址.

My question is why are the two tokens different. and how do i perform a check now to validate if the token exists in the database as i need to get the email address to post to the reset controller.

先感谢

推荐答案

您存储在数据库中的令牌的散列与 users 表中的 password 列相同. 但是,您收到的令牌不会被散列.那就是为什么他们与众不同

Token you store in database is hashed same as your password column in users table. However the token you recieve is not hashed. Thats why they are different

由于获得此密码;

$2y$10$N0WFuqEkEIFto.CazxYLdOUmY1X9tBHfvDn8iWKUdlq2W9uOc00Ku

您必须

Hash::make('bc1c82830bc8ad1356aa5e2a2a5a342ae6c6fabd385add503795cca1a1993e15');

Hash::make('bc1c82830bc8ad1356aa5e2a2a5a342ae6c6fabd385add503795cca1a1993e15');

无法将此过程向后还原.

And you cannot revert this process backwards.

这篇关于Laravel 5.4:密码重置令牌与电子邮件令牌不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆