forked from CGM_Public/pretix_original
Login: Detect redirect loop and give users useful advice (#5911)
This commit is contained in:
@@ -19,6 +19,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if possible_cookie_problem %}
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
It looks like your browser is not accepting our cookie and you need to log in repeatedly. Please
|
||||||
|
check if your browser is set to block cookies, or delete all existing cookies and retry.
|
||||||
|
{% endblocktrans %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% bootstrap_form form %}
|
{% bootstrap_form form %}
|
||||||
<div class="form-group buttons">
|
<div class="form-group buttons">
|
||||||
|
|||||||
@@ -149,6 +149,8 @@ def login(request):
|
|||||||
return process_login(request, form.user_cache, form.cleaned_data.get('keep_logged_in', False))
|
return process_login(request, form.user_cache, form.cleaned_data.get('keep_logged_in', False))
|
||||||
else:
|
else:
|
||||||
form = LoginForm(backend=backend, request=request)
|
form = LoginForm(backend=backend, request=request)
|
||||||
|
# Detect redirection loop (usually means cookie not accepted)
|
||||||
|
ctx['possible_cookie_problem'] = request.path in request.headers.get("Referer", "")
|
||||||
ctx['form'] = form
|
ctx['form'] = form
|
||||||
ctx['can_register'] = settings.PRETIX_REGISTRATION
|
ctx['can_register'] = settings.PRETIX_REGISTRATION
|
||||||
ctx['can_reset'] = settings.PRETIX_PASSWORD_RESET
|
ctx['can_reset'] = settings.PRETIX_PASSWORD_RESET
|
||||||
|
|||||||
Reference in New Issue
Block a user