mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
login: Enable non-email username to login.
This commit is contained in:
@@ -73,10 +73,19 @@ common.autofocus('#id_username');
|
||||
|
||||
<!-- .no-validation is for removing the red star in CSS -->
|
||||
<div class="input-box no-validation">
|
||||
<input id="id_username" type="email" name="username" class="email required"
|
||||
<input id="id_username" type="{% if not require_email_format_usernames %}text{% else %}email{% endif %}"
|
||||
name="username" class="{% if require_email_format_usernames %}email {% endif %}required"
|
||||
{% if email %} value="{{ email }}" {% else %} value="" {% endif %}
|
||||
maxlength="72" required />
|
||||
<label for="id_username">{{ _('Email') }}</label>
|
||||
<label for="id_username">
|
||||
{% if not require_email_format_usernames and email_auth_enabled %}
|
||||
{{ _('Email or username') }}
|
||||
{% elif not require_email_format_usernames %}
|
||||
{{ _('Username') }}
|
||||
{% else %}
|
||||
{{ _('Email') }}
|
||||
{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="input-box no-validation">
|
||||
|
||||
@@ -11,6 +11,8 @@ from zproject.backends import (
|
||||
github_auth_enabled,
|
||||
google_auth_enabled,
|
||||
password_auth_enabled,
|
||||
email_auth_enabled,
|
||||
require_email_format_usernames,
|
||||
auth_enabled_helper,
|
||||
AUTH_BACKEND_NAME_MAP
|
||||
)
|
||||
@@ -127,6 +129,8 @@ def zulip_default_context(request):
|
||||
'dev_auth_enabled': dev_auth_enabled(realm),
|
||||
'google_auth_enabled': google_auth_enabled(realm),
|
||||
'github_auth_enabled': github_auth_enabled(realm),
|
||||
'email_auth_enabled': email_auth_enabled(realm),
|
||||
'require_email_format_usernames': require_email_format_usernames(realm),
|
||||
'any_oauth_backend_enabled': any_oauth_backend_enabled(realm),
|
||||
'no_auth_enabled': not auth_enabled_helper(list(AUTH_BACKEND_NAME_MAP.keys()), realm),
|
||||
'development_environment': settings.DEVELOPMENT,
|
||||
|
||||
Reference in New Issue
Block a user