コード例 #1
0
        public void CloseUserAccount(UserAccount user)
        {
            SecurityVerify.Verify <CloseGoogleAuth>(new CustomVerifier("CloseGoogleAuth"), SystemPlatform.FiiiPay, user.Id.ToString(), (model) =>
            {
                return(model.PinVerified && model.CombinedVerified);
            });

            var userDAC = new UserAccountDAC();
            var oldFlag = user.ValidationFlag;
            var newFlag = ValidationFlagComponent.ReduceValidationFlag(oldFlag, ValidationFlag.GooogleAuthenticator);

            userDAC.UpdateGoogleAuthencator(user.Id, newFlag);
        }
コード例 #2
0
        public void BindUserAccount(BindUserAuthIM im, UserAccount user)
        {
            SecurityVerify.Verify <BindGoogleAuth>(new CustomVerifier("BindGoogleAuth"), SystemPlatform.FiiiPay, user.Id.ToString(), (model) =>
            {
                return(model.PinVerified && model.GoogleVerified && model.CombinedVerified);
            });

            var userDAC = new UserAccountDAC();

            if (string.IsNullOrEmpty(user.AuthSecretKey))
            {
                var oldFlag = user.ValidationFlag;
                var newFlag = ValidationFlagComponent.AddValidationFlag(oldFlag, ValidationFlag.GooogleAuthenticator);
                userDAC.UpdateGoogleAuthencator(user.Id, im.SecretKey, newFlag);
            }
            else
            {
                userDAC.SetAuthSecretById(user.Id, im.SecretKey);
            }
        }