Email confirmation fail on multiple confirmation attempts (#8656)

If an user already confirmed his email address and tries to confirm it again it should fail.
This commit is contained in:
Alessandro Agostini
2023-03-17 09:12:18 +01:00
committed by GitHub
parent 7ac17272d2
commit d5acf2dc41

View File

@@ -120,7 +120,11 @@ namespace Orchard.Users.Services {
var user = _membershipService.GetUser(username);
if (user == null)
return null;
if (user.As<UserPart>().EmailStatus == UserStatus.Approved) {
return null;
}
user.As<UserPart>().EmailStatus = UserStatus.Approved;
return user;
@@ -195,4 +199,4 @@ namespace Orchard.Users.Services {
return user;
}
}
}
}