Exemple #1
0
 /**
  * Controller
  * Injected services :
  *  UserManager
  *  SignInManager
  */
 public AccountController(UserManager <ApplicationUser> userManager,
                          RoleManager <IdentityRole> roleManager,
                          SignInManager <ApplicationUser> signInManager,
                          IConfiguration configuration,
                          IGoogleRecaptchaService googleRecaptchaService)
 {
     this.userManager            = userManager;
     this.roleManager            = roleManager;
     this.signInManager          = signInManager;
     this.configuration          = configuration;
     this.googleRecaptchaService = googleRecaptchaService;
     emailHandler = new EmailHandler(configuration);
 }
 public AdvertismentController(IWebHostEnvironment IHostingEnvironment,
                               UserManager <ApplicationUser> userManager,
                               IAdvertismentRepository repository,
                               IGoogleRecaptchaService googleRecaptchaService,
                               ICurrency currencyContainer)
 {
     hostingEnvironment          = IHostingEnvironment;
     this.userManager            = userManager;
     this.advertismentRepository = repository;
     this.googleRecaptchaService = googleRecaptchaService;
     this.currencyContainer      = currencyContainer;
     carModelsJsonPath           = Path.Combine(hostingEnvironment.WebRootPath, "Resource", "CarTypes.json");
 }
Exemple #3
0
 public EmailService(IGoogleRecaptchaService recaptchaService, IConfiguration config)
 {
     _recaptchaService = recaptchaService;
     _config           = config;
     _smtpSettings     = new SmtpSettings()
     {
         Host        = _config["smtp:Host"],
         Port        = Convert.ToInt32(_config["smtp:Port"]),
         IsSSL       = Convert.ToBoolean(_config["smtp:IsSSL"]),
         SenderEmail = _config["smtp:SenderEmail"],
         SenderName  = _config["smtp:SenderName"],
         Password    = _config["GmailPassword"]
     };
 }
Exemple #4
0
        public async Task <IActionResult> SendRecaptcha(
            [FromForm(Name = "g-recaptcha-response")] string token
            , [FromServices] IGoogleRecaptchaService googleRecaptchaService)
        {
            var request = new GoogleRecaptchaRequest
            {
                Token = token
            };
            var result = await googleRecaptchaService.ValidateReCaptcha(request);

            if (result.ValidToken)
            {
                return(View("Index"));
            }

            return(Error());
        }
 public AccountController(UserManager <ApplicationUser> userManager,
                          SignInManager <ApplicationUser> signInManager,
                          RoleManager <IdentityRole> roleManager,
                          IOptions <AppSettings> appSettings,
                          IAccountRepository repository,
                          IMessageService messageService,
                          IDataProtectionProvider provider,
                          IGoogleRecaptchaService gRecaptchaService)
 {
     _userManager       = userManager;
     _signInManager     = signInManager;
     _roleManager       = roleManager;
     _appSettings       = appSettings.Value;
     _repository        = repository;
     _messageService    = messageService;
     _protector         = provider.CreateProtector("ExodusKorea");
     _gRecaptchaService = gRecaptchaService;
 }
 public AccountController(
     IRoutinizeAccountLogService accountLogService,
     IAccountService accountService,
     IChallengeService challengeService,
     IAssistantService assistantService,
     IEmailSenderService emailSenderService,
     ITwoFactorAuthService tfaService,
     IGoogleRecaptchaService recaptchaService
     )
 {
     _accountLogService  = accountLogService;
     _accountService     = accountService;
     _challengeService   = challengeService;
     _assistantService   = assistantService;
     _emailSenderService = emailSenderService;
     _tfaService         = tfaService;
     _recaptchaService   = recaptchaService;
 }
 public ContactController(IEmailService emailService, IGoogleRecaptchaService gCaptchaService)
 {
     _emailService    = emailService;
     _gCaptchaService = gCaptchaService;
 }