重置密码,果园未更新
问题说明
使用果园1.6.在控制台的设置"部分中,我启用了显示链接以使用户可以重置密码"
Using Orchard 1.6. In the settings section in the Dashboard I have enabled 'Display a link to enable users to reset their password'
在服务器上更新此功能后,用户现在可以请求将丢失的密码电子邮件发送给他们,从而允许他们更改密码.一切正常,但是新密码不起作用.并且旧密码仍然有效?为什么会这样?
After updating this feature on the server the user can now request a lost password email be sent to them which allows them to change their password. This all works fine however the new password does not take affect. and the old password still works? why is this?
感谢您的答复
正确答案
我刚刚遇到了这个问题.我正在使用Orchard 1.7.
I just had this issue. I am using Orchard 1.7.
问题似乎来自以下事实:尝试修改密码并将用户重定向到首页时,随机数为null.
The problems seem to come from the fact that the nonce is null when trying to modify the password, redirecting the user to the home page.
首先,我修改了Orchard.Users.AccountController LostPassword控制器,使其看起来像这样:
First, I modified the Orchard.Users.AccountController LostPassword controller to look like this :
public ActionResult LostPassword(string nonce) {
if ( _userService.ValidateLostPassword(nonce) == null ) {
return RedirectToAction("LogOn");
}
ViewData["nonce"] = nonce; //add this line
ViewData["PasswordLength"] = MinPasswordLength;
return View();
}
然后,您需要修改LostPassword.cshtml并将此行添加到表单中:
Then, you need to modify the LostPassword.cshtml and add this line within the form :
@Html.Hidden("nonce",ViewData["nonce"])
这可以确保在发布新密码时随机数会被传回并解决该问题.
This assures that the nonce gets passed back when posting the new password and fixes the issue.
希望这会有所帮助.
不要忘记,您还需要在主题的LostPassword.cshtml文件中添加该行.如果不这样做,您仍然会遇到此错误.
Don't forget that you need to add that line in your theme's LostPassword.cshtml file as well. If you don't you will still have this error.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcciheg
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
使用c++17更新时出现G++编译器警告
it1352 06-18 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20