This commit is contained in:
@@ -383,12 +383,21 @@ namespace AyaNova.PlugIn.QBOI
|
||||
{
|
||||
return;
|
||||
}
|
||||
IntegrationLog.Log(QBID, "RefreshTokens: Token expired, fetching new one...");
|
||||
try
|
||||
{
|
||||
|
||||
//refresh token here
|
||||
var v = oac.RefreshTokenAsync(REFRESH_TOKEN).Result;
|
||||
TOKEN_BIRTHDAY = DateTime.Now;
|
||||
ACCESS_TOKEN = v.AccessToken;
|
||||
REFRESH_TOKEN = v.RefreshToken;
|
||||
//refresh token here
|
||||
var v = oac.RefreshTokenAsync(REFRESH_TOKEN).Result;
|
||||
TOKEN_BIRTHDAY = DateTime.Now;
|
||||
ACCESS_TOKEN = v.AccessToken;
|
||||
REFRESH_TOKEN = v.RefreshToken;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
IntegrationLog.Log(QBID, "RefreshTokens: Exception error attempting to refresh token:");
|
||||
IntegrationLog.Log(QBID, CrackException(ex));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -574,8 +583,9 @@ namespace AyaNova.PlugIn.QBOI
|
||||
if (!_AuthenticationCompleted)
|
||||
{
|
||||
IntegrationLog.Log(QBID, "PFC: Authenticating...");
|
||||
if (!StartAuthorization()) {
|
||||
//user cancelled or some other issue, close qboi
|
||||
if (!StartAuthorization())
|
||||
{
|
||||
//user cancelled or some other issue, close qboi
|
||||
IntegrationLog.Log(QBID, "PFC: QuickBooks connection not authorized");
|
||||
return pfstat.Cancel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user