log_into_subdomain: Fix realm creation on servers using an IP address.

While it's totally fine to put a leading '.' before the cookie domain
for normal hostnames and browsers will just strip them, if you're
using an IP address, it doesn't work, because .127.0.0.1 (for example)
is just invalid, and the cookie won't be set.

This fixes an issue where after installing with an IP address, realm
creation would end with being stuck at a blank page for
/accounts/login/subdomain/.
This commit is contained in:
Tim Abbott 2017-10-24 14:05:50 -07:00
parent 730c77c7df
commit 4439dbf781
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ def redirect_and_log_into_subdomain(realm, full_name, email_address,
reverse('zerver.views.auth.log_into_subdomain')
])
domain = '.' + settings.EXTERNAL_HOST.split(':')[0]
domain = settings.EXTERNAL_HOST.split(':')[0]
response = redirect(subdomain_login_uri)
data = {'name': full_name, 'email': email_address, 'subdomain': realm.subdomain,