コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public async Task VerifySmsCode(VerifySmsCodeInputDto input)
 {
     await ApiClient.PostAsync(GetEndpoint(nameof(VerifySmsCode)));
 }