Skip to content

Commit

Permalink
Improve login screen when only OmniAuth providers are enabled
Browse files Browse the repository at this point in the history
Hide the text "No authentication methods configured." when Signin and LDAP are disabled but OmniAuth is enabled.
Hide the link to "Did not receive confirmation email?" when Signup is disabled.
Only show the horizontal rule between the login form and omniauth buttons if both are enabled
  • Loading branch information
sodabrew committed Aug 24, 2014
1 parent 0cfa8aa commit df59fbc
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions app/views/devise/sessions/new.html.haml
Expand Up @@ -2,6 +2,7 @@
.login-heading
%h3 Sign in
.login-body
- no_auth = 0
- if ldap_enabled? && gitlab_config.signin_enabled
%ul.nav.nav-tabs
%li.active
Expand All @@ -19,23 +20,29 @@
- elsif gitlab_config.signin_enabled
= render partial: 'devise/sessions/new_base'
- else
- no_auth += 1

- if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?
- if no_auth == 0
%hr
= render partial: 'devise/sessions/oauth_providers'
- else
- no_auth += 1

- if no_auth == 2
%div
No authentication methods configured.

= render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?

.login-footer
- if gitlab_config.signup_enabled
%p
%span.light
Don't have an account?
%strong
= link_to "Sign up", new_registration_path(resource_name)

%p
%span.light Did not receive confirmation email?
= link_to "Send again", new_confirmation_path(resource_name)

%p
%span.light Did not receive confirmation email?
= link_to "Send again", new_confirmation_path(resource_name)

- if extra_config.has_key?('sign_in_text')
%hr
Expand Down

0 comments on commit df59fbc

Please sign in to comment.