Show a SSO login page for SSO users that just has a login button

(imported from commit 0004bf8710491f4e2d967b4367b37d57833845ee)
This commit is contained in:
Leo Franchi 2013-11-14 10:56:07 -05:00
parent be3257de62
commit 5fd97e48c3
3 changed files with 19 additions and 6 deletions

View File

@ -864,7 +864,7 @@ a.bottom-signup-button {
font-weight: 300;
}
.login-google, .register-google {
.login-google, .register-google, .login-sso {
width: 300px;
margin: auto;
text-align: center;

View File

@ -25,6 +25,16 @@ autofocus('#id_username');
<h3 class="login-page-header">You look familiar.</h3>
{% if only_sso %}
{% comment %}SSO users don't have a password.{% endcomment %}
<div class="login-sso">
<a href="/accounts/login/sso" class="btn btn-large btn-primary">Sign in with SSO</a>
</div>
{% else %}
{% comment %}Non-SSO users.{% endcomment %}
{% if form.errors or sso_unknown_email %}
<div class="alert alert-error">
{% if sso_unknown_email %}
@ -38,11 +48,11 @@ autofocus('#id_username');
</div>
{% endif %}
{% if email %}
<div class="alert">
You've already registered with this email address. Please log in below.
</div>
{% endif %}
{% if email %}
<div class="alert">
You've already registered with this email address. Please log in below.
</div>
{% endif %}
<form name="login_form" id="login_form" method="post" class="login-form"
{% if sso_only %}
@ -86,6 +96,8 @@ autofocus('#id_username');
</div>
{% endif %}
{% endif %}
</div>
<div class="footer-padder"></div>
</div>

View File

@ -14,6 +14,7 @@ def add_settings(request):
'zulip_admin': settings.ZULIP_ADMINISTRATOR,
'password_auth_enabled': password_auth_enabled(),
'login_url': settings.HOME_NOT_LOGGED_IN,
'only_sso': settings.ONLY_SSO,
}
def add_metrics(request):