public ServiceResult <LoginOM> ValidateLogin(ValidateAuthCodeIM im) { ServiceResult <LoginOM> result = new ServiceResult <LoginOM>(); string deviceNumber = this.GetDeviceNumber(); if (string.IsNullOrEmpty(deviceNumber)) { result.Code = ReasonCode.MISSING_REQUIRED_FIELDS; return(result); } result.Data = new UserAccountComponent().ValidateAuthenticator(im, deviceNumber); return(result); }
public LoginOM ValidateAuthenticator(ValidateAuthCodeIM im, string deviceNumber) { var user = CheckUser(im.CountryId, im.Cellphone, im.Password); var deviceList = new UserDeviceDAC().GetUserDeviceByAccountId(user.Id); if (!deviceList.Any()) { new ApplicationException(); } if (deviceList.All(item => item.DeviceNumber != deviceNumber)) { new ApplicationException(); } SecurityVerify.Verify(new GoogleVerifier(), SystemPlatform.FiiiPay, user.Id.ToString(), user.AuthSecretKey, im.GoogleCode); return(IssueAccessToken(user)); }