Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class SetPasswordSaveAction : UserBaseAction
{
private ID _formId;
public override void Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext = null,
params object[] data)
{
_formId = formId;
var password = adaptedFields.GetEntry(PasswordField, "Password")?.Value ?? string.Empty;
var userName = Tracker.Current?.Session.Contact.Identifiers.Identifier;
var user = Membership.GetUser(userName);
if (user == null) return;
var tempPass = user.ResetPassword();
user.ChangePassword(tempPass, password);
}
public override FormItem CurrentForm => FormItem.GetForm(_formId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment