From ebdbd25082bab38a41418857b2bd86c19508f648 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Sat, 4 Jan 2020 23:45:00 -0500 Subject: [PATCH] Update qbo.rb --- app/models/qbo.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/qbo.rb b/app/models/qbo.rb index 35962a3..5bb8902 100644 --- a/app/models/qbo.rb +++ b/app/models/qbo.rb @@ -11,7 +11,8 @@ class Qbo < ActiveRecord::Base unloadable validates_presence_of :qb_token, :qb_secret, :company_id, :token_expires_at, :reconnect_token_at - + serialize :token + OAUTH_CONSUMER_KEY = Setting.plugin_redmine_qbo['settingsOAuthConsumerKey'] OAUTH_CONSUMER_SECRET = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret'] @@ -35,7 +36,7 @@ class Qbo < ActiveRecord::Base oauth2_client = get_client qbo = self.first #access_token = OAuth2::AccessToken.new(oauth2_client, qbo.qb_token , refresh_token: qbo.qb_secret) - access_token = OAuth2::AccessToken.from_hash(oauth2_client, eval( qbo.token) ) + access_token = OAuth2::AccessToken.from_hash(oauth2_client, qbo.token ) # check to see if we need to refresh the token if qbo.expire.to_date.past?