Password reset
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Configuration;
|
||||
using System.Web;
|
||||
using LeafWeb.Core.Entities;
|
||||
using LeafWeb.WebCms.Controllers;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace LeafWeb.WebCms.Services
|
||||
@@ -10,6 +11,8 @@ namespace LeafWeb.WebCms.Services
|
||||
private readonly string _downloadUrl;
|
||||
private readonly string _chartUrl;
|
||||
private readonly string _verifyEmailUrl;
|
||||
private readonly string _passwordResetUrl;
|
||||
private readonly string _registerUrl;
|
||||
|
||||
public UrlService()
|
||||
{
|
||||
@@ -24,9 +27,17 @@ namespace LeafWeb.WebCms.Services
|
||||
_verifyEmailUrl =
|
||||
ConfigurationManager.AppSettings["LeafWebUrl"]
|
||||
+ ConfigurationManager.AppSettings["MemberVerifyPath"];
|
||||
|
||||
_passwordResetUrl =
|
||||
ConfigurationManager.AppSettings["LeafWebUrl"]
|
||||
+ ConfigurationManager.AppSettings["PasswordResetPath"];
|
||||
|
||||
_registerUrl =
|
||||
ConfigurationManager.AppSettings["LeafWebUrl"]
|
||||
+ ConfigurationManager.AppSettings["RegisterPath"];
|
||||
}
|
||||
|
||||
public string GetDownloadUrl(LeafInput leafInput)
|
||||
public string GetDownloadUrl(LeafInput leafInput)
|
||||
{
|
||||
return string.Format(_downloadUrl, leafInput.UniqueToken);
|
||||
}
|
||||
@@ -36,11 +47,20 @@ namespace LeafWeb.WebCms.Services
|
||||
return string.Format(_chartUrl, leafInput.UniqueToken);
|
||||
}
|
||||
|
||||
public string GetVerifyEmailURl(IMember member)
|
||||
public string GetVerifyEmailUrl(IMember member)
|
||||
{
|
||||
var memberEmail = member.Email;
|
||||
var token = member.GetValue("VerificationToken") as string;
|
||||
var token = member.GetValue<string>(LeafWebMemberProperties.VerificationToken);
|
||||
return string.Format(_verifyEmailUrl, HttpUtility.UrlEncode(memberEmail), token);
|
||||
}
|
||||
|
||||
public string GetPasswordResetUrl(IMember member)
|
||||
{
|
||||
var memberEmail = member.Email;
|
||||
var token = member.GetValue<string>(LeafWebMemberProperties.PasswordResetToken);
|
||||
return string.Format(_passwordResetUrl, HttpUtility.UrlEncode(memberEmail), token);
|
||||
}
|
||||
|
||||
public string GetRegisterUrl() => _registerUrl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user