本文介绍了在WebApi中生成重置密码链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想生成一个重置密码链接以发送到用户的电子邮件,该电子邮件将打开ResetPassword页面.在此页面上,我将填写有关新密码的详细信息,然后确认密码.
I wanted to generate a reset password link to send to the user's email that will open the ResetPassword page. On this page I will fill in the details regarding the new password and then confirm the password.
为此,我遵循了 链接
For this I have followed this Link
但是有一个我无法在我的Web api项目中找到的Url.Action方法.
But there is a Url.Action method that i am not able to find in my web api project.
var callbackUrl = Url.Action(
"ConfirmEmail", "Account",
new { userId = user.Id, code = code },
protocol: Request.Url.Scheme);
是否有人在网络api中完成了重置密码部分?我需要帮助.
Hase anybody done the reset password part in the web api? I need some help.
推荐答案
您可以在Web API 2.0中使用 Url.Link
You can use Url.Link
in Web API 2.0
var callbackUrl = Url.Link("Default", new { Controller = "Account",
Action = "ConfirmEmail", userId = user.Id, code = code });
这篇关于在WebApi中生成重置密码链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!