public ServiceResult <bool> Bind(BindUserAuthIM im) { new AuthenticatorComponent().BindUserAccount(im, this.GetUser()); return(new ServiceResult <bool> { Data = true }); }
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); } }