コード例 #1
0
        protected virtual IActionResult RecoverPassword(RecoverPasswordRequest recoverPasswordRequest)
        {
            if (recoverPasswordRequest == null)
            {
                return(BadRequest());
            }

            var loginResponse = PasswordRecoveryBusiness.RecoverPassword(recoverPasswordRequest.Code, recoverPasswordRequest.Password);

            return(Ok(new { jwt = GenerateToken(loginResponse.Email), data = loginResponse }));
        }
コード例 #2
0
        protected virtual async Task <IActionResult> ForgotPasswordAsync(ForgotPasswordRequest forgotPasswordRequest)
        {
            if (forgotPasswordRequest == null)
            {
                return(BadRequest());
            }
            if (!IsValidRecaptcha(forgotPasswordRequest.Captcha))
            {
                return(BadRequest(new { error = "Invalid Captcha." }));
            }

            await PasswordRecoveryBusiness.SendEmailForForgottenPasswordAsync(forgotPasswordRequest.Email);

            return(Ok());
        }
コード例 #3
0
ファイル: AccountServices.cs プロジェクト: mohnuris/Alpha
 public async Task SendEmailForForgottenPassword(string email)
 {
     await PasswordRecoveryBusiness.SendEmailForForgottenPassword(email);
 }
コード例 #4
0
ファイル: AccountServices.cs プロジェクト: mohnuris/Alpha
 public void RecoverPassword(string code, string password)
 {
     PasswordRecoveryBusiness.RecoverPassword(code, password);
 }