コード例 #1
0
        public async Task <ActionResult> SendCode(SendCodeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            // Generate the token and send it
            if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider))
            {
                return(View("Error"));
            }
            return(RedirectToAction("VerifyCode",
                                    new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }));
        }
コード例 #2
0
        public async Task <ActionResult> SendCode(SendCodeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            // Generates and sends the token
            if (!await signInManager.SendTwoFactorCodeAsync(model.SelectedProvider))
            {
                return(View("Error"));
            }
            return(RedirectToAction(nameof(VerifyCode),
                                    new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, userId = model.UserId }));
        }
コード例 #3
0
        public async Task <ActionResult> SendCode(SendCodeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            // Generate the token and send it
            if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider))
            {
                DemLogger.Current.Error($"{nameof(AdministrationController)}. POST Action SendCode: SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider) return false");
                return(View("Error"));
            }
            return(RedirectToAction("VerifyCode", new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }));
        }
コード例 #4
0
ファイル: AccountRepository.cs プロジェクト: poxet/Quilt4
 public async Task <bool> SendTwoFactorCodeAsync(string provider)
 {
     return(await ApplicationSignInManager.SendTwoFactorCodeAsync(provider));
 }
コード例 #5
0
 public async Task <bool> SendCode(string selectedProvider)
 {
     return(await _signInManager.SendTwoFactorCodeAsync(selectedProvider));
 }
コード例 #6
0
        public async Task <bool> SendTwoFactorCodeAsync(ApplicationSignInManager signInManager, string selectedProvider)
        {
            var result = await signInManager.SendTwoFactorCodeAsync(selectedProvider);

            return(result);
        }
コード例 #7
0
 public async Task <bool> EnviarToken(string provedor)
 {
     return(await _signInManager.SendTwoFactorCodeAsync(provedor));
 }