Skip to content

Commit

Permalink
replace ProConnect Login/Logout routes by LoginView, and switches on …
Browse files Browse the repository at this point in the history
…logout views
  • Loading branch information
vincentporte committed Nov 13, 2024
1 parent 14ecc3b commit 691a0a5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lacommunaute/openid_connect/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_normal_signin(self):

# Then log in again.
response = self.client.get(reverse("pages:home"))
self.assertContains(response, reverse("openid_connect:authorize"))
self.assertContains(response, reverse("members:login"))

response = mock_oauth_dance(self, assert_redirects=False)
expected_redirection = reverse("pages:home")
Expand Down
8 changes: 4 additions & 4 deletions lacommunaute/pages/tests/__snapshots__/test_homepage.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
</li>

<li>
<a class="btn" href="/pro_connect/authorize" rel="nofollow">Se connecter | S'inscrire</a>
</li>
<a class="btn btn-outline-primary btn-ico btn-block" href="/members/login/?next=/" rel="nofollow">Se connecter | S'inscrire</a>
</li>

</ul>
</nav>
Expand Down Expand Up @@ -257,8 +257,8 @@
<nav aria-label="Menu de navigation principale pour mobile" role="navigation">

<div>
<a class="btn" href="/pro_connect/authorize" rel="nofollow">Se connecter | S'inscrire</a>
</div>
<a class="btn btn-outline-primary btn-ico btn-block" href="/members/login/?next=/" rel="nofollow">Se connecter | S'inscrire</a>
</div>

</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/surveys/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
location_field_list = ["location", "city_code"]

form_html = '<form method="post">'
login_with_next_url = reverse("openid_connect:authorize") + "?next=" + reverse("surveys:dsp_create")
login_with_next_url = reverse("members:login") + "?next=" + reverse("surveys:dsp_create")


class TestDSPCreateView:
Expand Down
16 changes: 4 additions & 12 deletions lacommunaute/templates/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,12 @@
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item text-danger" id="js-logout" href="{% url 'openid_connect:logout' %}">Déconnexion</a>
</li>
<li>{% include "registration/includes/logout_link.html" %}</li>
</ul>
</div>
</li>
{% else %}
<li>
<a href="{% url 'openid_connect:authorize' %}" rel="nofollow" class="btn">Se connecter | S'inscrire</a>
</li>
<li>{% include "registration/includes/login_signin_link.html" %}</li>
{% endif %}
</ul>
</nav>
Expand Down Expand Up @@ -277,16 +273,12 @@ <h4 class="h5 mb-0 btn-ico align-items-center" id="offcanvasApplyFiltersLabel">
<li>
<div class="dropdown-divider"></div>
</li>
<li>
<a class="dropdown-item text-danger" id="js-logout" href="{% url 'openid_connect:logout' %}">Déconnexion</a>
</li>
<li>{% include "registration/includes/logout_link.html" %}</li>
</ul>
</div>
</div>
{% else %}
<div>
<a href="{% url 'openid_connect:authorize' %}" rel="nofollow" class="btn">Se connecter | S'inscrire</a>
</div>
<div>{% include "registration/includes/login_signin_link.html" %}</div>
{% endif %}
</nav>
</div>
Expand Down
4 changes: 1 addition & 3 deletions lacommunaute/templates/surveys/dsp_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ <h1 class="s-title-01__title h1">Diagnostic Parcours IAE</h1>
<div class="c-box mb-5">
<div class="row">
<div class="col-lg col-12 mb-3">Je me connecte pour accéder à l'aide au diagnostic pour le parcours IAE</div>
<div class="col-lg-auto col-12">
<a href="{% url 'openid_connect:authorize' %}?next={% url 'surveys:dsp_create' %}" rel="nofollow" class="btn btn-outline-primary btn-ico btn-block">Me connecter</a>
</div>
<div class="col-lg-auto col-12">{% include "registration/includes/login_signin_link.html" %}</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 691a0a5

Please sign in to comment.