Make sure login redirects (?next=) work

This commit is contained in:
Tobias Kunze 2025-03-21 15:58:59 +01:00
parent 4e603246f7
commit 81396297f9
2 changed files with 3 additions and 1 deletions

View file

@ -14,6 +14,7 @@
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %} {% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
<form method="post" action="{{ href }}"> <form method="post" action="{{ href }}">
{% csrf_token %} {% csrf_token %}
{{ redirect_field }}
<button href="{{ href }}" <button href="{{ href }}"
class="btn btn-warning btn-lg icon icon-left" class="btn btn-warning btn-lg icon icon-left"
title="{{ provider.name }}"> title="{{ provider.name }}">
@ -39,7 +40,7 @@
style="max-width: 400px"> style="max-width: 400px">
{% url 'account_login' as form_action %} {% url 'account_login' as form_action %}
{% translate "Sign In" as form_submit_label %} {% translate "Sign In" as form_submit_label %}
{% include "includes/form.html" %} {% include "includes/form.html" with extra_field=redirect_field %}
</div> </div>
</div> </div>
{% endblock card_content %} {% endblock card_content %}

View file

@ -5,6 +5,7 @@
{% include "includes/form_errors.html" %} {% include "includes/form_errors.html" %}
{% csrf_token %} {% csrf_token %}
{{ form }} {{ form }}
{% if extra_field %}{{ extra_field }}{% endif %}
<div class="col-sm-12 d-flex justify-content-end"> <div class="col-sm-12 d-flex justify-content-end">
<button class="btn btn-primary me-1 mb-1" type="submit"> <button class="btn btn-primary me-1 mb-1" type="submit">
{% if form_submit_label %} {% if form_submit_label %}