예제 #1
0
        public HttpResponseMessage ForgotPassword(Guid tokenGuid)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.RedirectMethod);

            try
            {
                _emailConfirmationService.SelectById(tokenGuid);
                string domain = HttpContext.Current.Request.IsLocal ? "http://localhost:1552" : "https://snatched.azurewebsites.net";
                response.Headers.Location = new Uri(domain + "/Member/ResetPassword/" + tokenGuid);

                return(response);
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
예제 #2
0
        public bool ResetPassword(ResetPasswordUpdateRequest model)
        {
            bool result = false;

            try
            {
                string UserId = _emailConfirmationService.SelectById(model.TokenGuid);

                if (!String.IsNullOrEmpty(UserId))
                {
                    ChangePassWord(UserId, model.NewPassword);
                    result = true;
                }
                return(result);
            }
            catch (Exception ex)
            {
                _baseService.LogError(System.Reflection.MethodBase.GetCurrentMethod().Name, ex, "User Service Reset Password");
                throw;
            }
        }