diff options
Diffstat (limited to 'app/helpers/jira_connect_helper.rb')
-rw-r--r-- | app/helpers/jira_connect_helper.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/helpers/jira_connect_helper.rb b/app/helpers/jira_connect_helper.rb index 79638ac75b1..4ddfb0224d1 100644 --- a/app/helpers/jira_connect_helper.rb +++ b/app/helpers/jira_connect_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module JiraConnectHelper - def jira_connect_app_data(subscriptions, installation) + def jira_connect_app_data(subscriptions) skip_groups = subscriptions.map(&:namespace_id) { @@ -11,16 +11,14 @@ module JiraConnectHelper subscriptions_path: jira_connect_subscriptions_path(format: :json), users_path: current_user ? nil : jira_connect_users_path, # users_path is used to determine if user is signed in gitlab_user_path: current_user ? user_path(current_user) : nil, - oauth_metadata: Feature.enabled?(:jira_connect_oauth, current_user) ? jira_connect_oauth_data(installation).to_json : nil + oauth_metadata: Feature.enabled?(:jira_connect_oauth, current_user) ? jira_connect_oauth_data.to_json : nil } end private - def jira_connect_oauth_data(installation) - oauth_instance_url = installation.oauth_authorization_url - - oauth_authorize_path = oauth_authorization_path( + def jira_connect_oauth_data + oauth_authorize_url = oauth_authorization_url( client_id: Gitlab::CurrentSettings.jira_connect_application_key, response_type: 'code', scope: 'api', @@ -29,8 +27,8 @@ module JiraConnectHelper ) { - oauth_authorize_url: Gitlab::Utils.append_path(oauth_instance_url, oauth_authorize_path), - oauth_token_url: Gitlab::Utils.append_path(oauth_instance_url, oauth_token_path), + oauth_authorize_url: oauth_authorize_url, + oauth_token_url: oauth_token_url, state: oauth_state, oauth_token_payload: { grant_type: :authorization_code, |