Exemplo n.º 1
0
 public UserRegistration(InWordsDataContext context,
                         IJwtProvider jwtProvider,
                         IEmailVerifierService emailVerifierService) : base(context)
 {
     this.jwtProvider          = jwtProvider;
     this.emailVerifierService = emailVerifierService;
 }
 public AddEmailAddressHandler(
     IUnitOfWork unitOfWork,
     IEmailVerifierService emailVerifierService,
     IAlphanumericTokenGenerator alphanumericTokenGenerator)
 {
     _unitOfWork                 = unitOfWork;
     _emailVerifierService       = emailVerifierService;
     _alphanumericTokenGenerator = alphanumericTokenGenerator;
 }
 public SendEmailVerificationMessageHandler(
     IUnitOfWork unitOfWork,
     IEmailVerifierService emailVerifierService,
     IAlphanumericTokenGenerator alphanumericTokenGenerator)
 {
     _unitOfWork                 = unitOfWork;
     _emailVerifierService       = emailVerifierService;
     _alphanumericTokenGenerator = alphanumericTokenGenerator;
 }
Exemplo n.º 4
0
 public CreateAccountHandler(
     IUnitOfWork unitOfWork,
     IPasswordHashingService passwordHashingService,
     IEmailVerifierService emailVerifierService,
     IAlphanumericTokenGenerator alphanumericTokenGenerator,
     ISecureRandomStringGeneratorService securePasswordSaltGenerator)
 {
     _unitOfWork                  = unitOfWork;
     _passwordHashingService      = passwordHashingService;
     _emailVerifierService        = emailVerifierService;
     _alphanumericTokenGenerator  = alphanumericTokenGenerator;
     _securePasswordSaltGenerator = securePasswordSaltGenerator;
 }
        public void SendVerificationRequest(IEmailVerifierService emailVerifier, IAlphanumericTokenGenerator tokenGenerator)
        {
            if (!IsVerified)
            {
                //disable all previous verification tokens
                VerificationTokens.ToList().ForEach(i => i.IsActive = false);

                var newToken = new EmailVerificationToken()
                {
                    VerificationToken = tokenGenerator.GenerateAlphanumericToken(64),
                    IsActive          = true,
                    EmailAddress      = this
                };

                VerificationTokens.Add(newToken);

                emailVerifier.AttemptToVerify(this, newToken);
            }
        }