public bool Verify(string accountId, string password, string inputOtp)
        {
            // 取得密碼hash
            var hashPassword = _hash.Compute(password);

            // 取得帳號當下的Otp
            var currentOtp = _otpService.Get(accountId);

            // 取得帳號的password
            var dbHashPassword = _profile.GetPassword(accountId);

            // 比對
            return(inputOtp == currentOtp && hashPassword == dbHashPassword);
        }
Beispiel #2
0
 private void PresetOtp(string accountId, string otp)
 {
     _otpService.Get(accountId).ReturnsForAnyArgs(otp);
 }