示例#1
0
        public ActionResult RequestPasswordRecovery([FromBody] RequestPasswordRecoveryModel model)
        {
            if (model == null ||
                string.IsNullOrWhiteSpace(model.EmailAddress))
            {
                return(CreateResponse("None of the parameters can be null"));
            }

            Validator validator = new Validator();

            if (!validator.IsValidEmail(model.EmailAddress))
            {
                return(CreateResponse("Invalid email address"));
            }

            KeyValuePair <bool, string> kv = userCore.GenerateRecoveryLink(model.EmailAddress);

            return(CreateResponse(kv.Value, success: kv.Key));
        }