public async Task VerifySmsCode(VerifySmsCodeInputDto input) { await _smsVerificationCodeManager.VerifyCodeAndShowUserFriendlyException(input.PhoneNumber, input.Code, input.SmsCodeType.ToString()); var user = GetUserByChecking(input.PhoneNumber); user.IsPhoneNumberConfirmed = true; await UserManager.UpdateAsync(user); }
public async Task VerifySmsCode(VerifySmsCodeInputDto input) { var cacheKey = AbpSession.ToUserIdentifier().ToString(); var cash = await _cacheManager.GetSmsVerificationCodeCache().GetOrDefaultAsync(cacheKey); if (cash == null) { throw new Exception("Phone numer confirmation code is not found in cache !"); } if (input.Code != cash.Code) { throw new UserFriendlyException(L("WrongSmsVerificationCode")); } var user = await UserManager.GetUserAsync(AbpSession.ToUserIdentifier()); user.IsPhoneNumberConfirmed = true; await UserManager.UpdateAsync(user); }
public async Task VerifySmsCode(VerifySmsCodeInputDto input) { await ApiClient.PostAsync(GetEndpoint(nameof(VerifySmsCode))); }