示例#1
0
        public bool Verify(string accountId, string password, string otp)
        {
            var passwordFromDb = _profileDao.GetPassword(accountId);
            var hashedPassword = _sha256Adapter.Compute(password);
            var currentOtp     = _otpService.GetCurrentOtp();

            return(passwordFromDb == hashedPassword && otp == currentOtp);
        }
示例#2
0
        public bool Verify(string accountId, string password, string otp)
        {
            var dbPassword = _profile.GetPassword(accountId);

            var hashPassword = _hash.GetHash(password);

            var currentOtp = _otp.GetCurrentOtp(accountId);

            return(hashPassword == dbPassword && currentOtp == otp);
        }
示例#3
0
        public bool Verify(string accountId, string password, string otp)
        {
            var passwordFromDB = _profile.GetPassword(accountId);

            var hashPassword = _hash.GetHash(password);

            var currentOtp = _otp.GetCurrentOtp(accountId);

            isVerify = passwordFromDB == hashPassword && currentOtp == otp;

            return(isVerify);
        }
        public bool Verify(string accountId, string password, string otp)
        {
            var passwordFromDb = _profile.GetPassword(accountId);

            var hashPassword = _hash.GetHash(password);

            var currentOtp = _otp.GetCurrentOtp(accountId);

            var isValid = currentOtp == otp &&
                          passwordFromDb == hashPassword;

            return(isValid);
        }
示例#5
0
        public bool Verify(string accountId, string password, string otp)
        {
            var hashedPasswordFromDb = _profile.GetPassword(accountId);

            var hashedPassword = _hash.GetHash(password);

            var currentOtp = _otpRemoteProxy.GetCurrentOtp(accountId);

            if (hashedPasswordFromDb == hashedPassword && currentOtp == otp)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 private void GivenOtp(string accountId, string otp)
 {
     _otpRemoteProxy.GetCurrentOtp(accountId).ReturnsForAnyArgs(otp);
 }
 private void GivenCurrentOtp(string otp)
 {
     _fakeOtp.GetCurrentOtp().Returns(otp);
 }
 private void GivenOtp(string accountId, string otp)
 {
     _otpService.GetCurrentOtp(accountId).ReturnsForAnyArgs(otp);
 }