コード例 #1
0
        public IActionResult RequestUserPassword([FromBody] string email)
        {
            string result;

            try
            {
                result = mLoginRepository.AddLoginRequest(email);
            }
            catch (UserException ex)
            {
                return(NotFound(new ApiResponse(null)
                {
                    Message = ex.Message
                }));
            }
            var url    = Url.Action(ValidateRequestEndpoint, values: new { token = result });
            var apiUrl = "/api" + url;
            var letter = MailComposer.ComposeChangePasswordLetter(apiUrl);

            // todo sending mail, for now just showing the letter, but by design apiUrl is to be returned
            return(Json(new ApiResponse(apiUrl)));
        }