mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Refactoring users challenge emails
- Adding unit tests - Creating a stub for email messages - Adding tenant's name to nonces in order to prevent cross-tenants substitution --HG-- branch : dev
This commit is contained in:
@@ -120,8 +120,7 @@ namespace Orchard.Users.Controllers {
|
||||
|
||||
if (user != null) {
|
||||
if ( user.As<UserPart>().EmailStatus == UserStatus.Pending ) {
|
||||
string challengeToken = _userService.GetNonce(user.As<UserPart>());
|
||||
_userService.SendChallengeEmail(user.As<UserPart>(), Url.AbsoluteAction(() => Url.Action("ChallengeEmail", "Account", new { Area = "Orchard.Users", token = challengeToken })));
|
||||
_userService.SendChallengeEmail(user.As<UserPart>(), nonce => Url.AbsoluteAction(() => Url.Action("ChallengeEmail", "Account", new { Area = "Orchard.Users", nonce = nonce })));
|
||||
|
||||
return RedirectToAction("ChallengeEmailSent");
|
||||
}
|
||||
|
@@ -197,8 +197,7 @@ namespace Orchard.Users.Controllers {
|
||||
var user = Services.ContentManager.Get(id);
|
||||
|
||||
if ( user != null ) {
|
||||
string challengeToken = _userService.GetNonce(user.As<UserPart>());
|
||||
_userService.SendChallengeEmail(user.As<UserPart>(), Url.AbsoluteAction(() => Url.Action("ChallengeEmail", "Account", new {Area = "Orchard.Users", token = challengeToken})));
|
||||
_userService.SendChallengeEmail(user.As<UserPart>(), nonce => Url.AbsoluteAction(() => Url.Action("ChallengeEmail", "Account", new {Area = "Orchard.Users", nonce = nonce})));
|
||||
}
|
||||
|
||||
Services.Notifier.Information(T("Challenge email sent"));
|
||||
|
Reference in New Issue
Block a user