summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSanad Liaquat <sliaquat@gitlab.com>2019-01-31 20:37:00 +0500
committerSanad Liaquat <sliaquat@gitlab.com>2019-01-31 20:37:00 +0500
commit5143dfec58b14250754f162574b7b7a07e85601d (patch)
tree042512db08162c31726c8a38d7917cd748ed9c0e /app
parent1a4a982aa8296b46f498a4b25b181d47168bfe65 (diff)
downloadgitlab-ce-qa-github-oauth-login-test.tar.gz
Implement review feedbackqa-github-oauth-login-test
Diffstat (limited to 'app')
-rw-r--r--app/helpers/auth_helper.rb7
-rw-r--r--app/views/devise/shared/_omniauth_box.html.haml2
2 files changed, 8 insertions, 1 deletions
diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb
index 01a0fb34484..966d1c10dac 100644
--- a/app/helpers/auth_helper.rb
+++ b/app/helpers/auth_helper.rb
@@ -16,6 +16,13 @@ module AuthHelper
PROVIDERS_WITH_ICONS.include?(name.to_s)
end
+ def qa_class_for_provider(provider)
+ {
+ saml: 'qa-saml-login-button',
+ github: 'qa-github-login-button'
+ }[provider.to_sym]
+ end
+
def auth_providers
Gitlab::Auth::OAuth::Provider.providers
end
diff --git a/app/views/devise/shared/_omniauth_box.html.haml b/app/views/devise/shared/_omniauth_box.html.haml
index 3758dbe93ba..1b583ea85d6 100644
--- a/app/views/devise/shared/_omniauth_box.html.haml
+++ b/app/views/devise/shared/_omniauth_box.html.haml
@@ -5,7 +5,7 @@
.d-flex.justify-content-between.flex-wrap
- providers.each do |provider|
- has_icon = provider_has_icon?(provider)
- = link_to omniauth_authorize_path(:user, provider), method: :post, class: "btn d-flex align-items-center omniauth-btn text-left oauth-login qa-#{provider}-login-button", id: "oauth-login-#{provider}" do
+ = link_to omniauth_authorize_path(:user, provider), method: :post, class: "btn d-flex align-items-center omniauth-btn text-left oauth-login #{qa_class_for_provider(provider)}", id: "oauth-login-#{provider}" do
- if has_icon
= provider_image_tag(provider)
%span