Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/models/concerns/smooch_zendesk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def zendesk_api_get_app_data(app_id)
def zendesk_api_client
payload = { scope: 'app' }
jwt_header = { kid: self.config['smooch_secret_key_key_id'] }
token = JWT.encode payload, self.config['smooch_secret_key_secret'], 'HS256', jwt_header
smooch_secret_key_secret = self.config['smooch_secret_key_secret'] || ' '
token = JWT.encode payload, smooch_secret_key_secret, 'HS256', jwt_header
config = SmoochApi::Configuration.new
config.api_key['Authorization'] = token
config.api_key_prefix['Authorization'] = 'Bearer'
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/graphql_controller_7_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def teardown
t = create_team private: true
b = create_team_bot login: 'smooch', set_approved: true
app_id = random_string
tbi = create_team_bot_installation team_id: t.id, user_id: b.id, settings: { smooch_app_id: app_id, smooch_secret_key_secret: random_string }
tbi = create_team_bot_installation team_id: t.id, user_id: b.id, settings: { smooch_app_id: app_id }
u = create_user
create_team_user user: u, team: t, role: 'admin'

Expand Down Expand Up @@ -148,7 +148,7 @@ def teardown
t = create_team private: true
b = create_team_bot login: 'smooch', set_approved: true
app_id = random_string
tbi = create_team_bot_installation team_id: t.id, user_id: b.id, settings: { smooch_app_id: app_id, smooch_secret_key_secret: random_string}
tbi = create_team_bot_installation team_id: t.id, user_id: b.id, settings: { smooch_app_id: app_id }
u = create_user
create_team_user user: u, team: t, role: 'admin'

Expand Down
2 changes: 1 addition & 1 deletion test/models/concerns/smooch_zendesk_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class << self
# Mock out config, which is normally set in the Smooch class as
# RequestStore.store[:smooch_bot_settings]
def config
{ "smooch_app_id" => 'app-id', "smooch_secret_key_secret" => 'app-secret-key' }
{ "smooch_app_id" => 'app-id' }
end

def replace_placeholders(uid, text)
Expand Down
Loading