mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Merge pull request #3 from sempervictus/bug-dont_call_string_method_on_nil_token
Do not permit OAUTH_CONSUMER_SECRET to be nil
This commit is contained in:
@@ -15,7 +15,7 @@ class CustomerToken < ActiveRecord::Base
|
|||||||
validates_presence_of :expires_at, :issue_id
|
validates_presence_of :expires_at, :issue_id
|
||||||
before_create :generate_token
|
before_create :generate_token
|
||||||
|
|
||||||
OAUTH_CONSUMER_SECRET = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret']
|
OAUTH_CONSUMER_SECRET = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret'] || 'CONFIGURE_QBO__' + SecureRandom.uuid
|
||||||
|
|
||||||
def generate_token
|
def generate_token
|
||||||
self.token = SecureRandom.base64(15).tr('+/=lIO0', OAUTH_CONSUMER_SECRET)
|
self.token = SecureRandom.base64(15).tr('+/=lIO0', OAUTH_CONSUMER_SECRET)
|
||||||
|
|||||||
Reference in New Issue
Block a user