예제 #1
0
        public async Task ProcessRequestAsync(ChangePinParameters data)
        {
            await _opcoVerifier.CheckIfOpCoHasPinServiceAsync(data.Requestor.OpCoId);

            var param = new VerifyPinParameters()
            {
                Requestor = data.Requestor,
                PinHash   = data.OldPinHash
            };
            var pinmodel = await _pinHashVerifier.VerifyPinHashAsync(param);

            var model = new PinChangeVerificationModel()
            {
                OpCoId  = data.Requestor.OpCoId,
                PinType = data.PinType,
                NewPin  = data.NewPin
            };
            await _pinChangeVerifier.CheckNewPinAgainstRulesAsync(model);

            var newpin = _pinHashGenerator.GeneratePinHashWithNewSalt(data.NewPin);

            pinmodel.PinHash = newpin.Hash;
            pinmodel.PinSalt = newpin.Salt;

            await _pinRepository.CreateOrUpdatePinAsync(data.Requestor, pinmodel);
        }
예제 #2
0
        public async Task ProcessRequestAsync(RequestorModel requestor, string newPin)
        {
            await _opcoVerifier.CheckIfOpCoHasPinServiceAsync(requestor.OpCoId);

            var model = new PinChangeVerificationModel()
            {
                OpCoId  = requestor.OpCoId,
                PinType = requestor.PinType,
                NewPin  = newPin
            };
            await _pinChangeVerifier.CheckNewPinAgainstRulesAsync(model);

            var newpin   = _pinHashGenerator.GeneratePinHashWithNewSalt(newPin);
            var pinmodel = new PinModel()
            {
                PinLocked = false,
                PinHash   = newpin.Hash,
                PinSalt   = newpin.Salt
            };

            await _pinRepository.CreateOrUpdatePinAsync(requestor, pinmodel);
        }
 public Task CheckNewPinAgainstRulesAsync(PinChangeVerificationModel data)
 {
     return(Task.CompletedTask);
 }