Projet

Général

Profil

0002-misc-add-registration-redirect-URL-to-whitelist-4730.patch

Benjamin Dauvergne, 13 octobre 2020 00:48

Télécharger (1,9 ko)

Voir les différences:

Subject: [PATCH 2/3] misc: add registration redirect URL to whitelist (#47302)

 src/authentic2/utils/__init__.py | 6 ++++++
 src/authentic2_auth_fc/views.py  | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
src/authentic2/utils/__init__.py
917 917
    for origin in app_settings.A2_REDIRECT_WHITELIST:
918 918
        if same_origin(next_url, origin):
919 919
            return True
920
    if app_settings.A2_REGISTRATION_REDIRECT:
921
        origin = app_settings.A2_REGISTRATION_REDIRECT
922
        if isinstance(origin, (tuple, list)):
923
            origin = origin[0]
924
        if same_origin(next_url, origin):
925
            return True
920 926
    result = hooks.call_hooks_first_result('good_next_url', next_url)
921 927
    if result is not None:
922 928
        return result
src/authentic2_auth_fc/views.py
571 571
        hooks.call_hooks('event', name='fc-unlink', user=self.request.user)
572 572
        messages.info(self.request, _('The link with the FranceConnect account has been deleted.'))
573 573
        links.delete()
574
        return super(UnlinkView, self).form_valid(form)
574
        response = super(UnlinkView, self).form_valid(form)
575
        if app_settings.logout_when_unlink:
576
            response.display_message = False
577
        return response
575 578

  
576 579
    def get_context_data(self, **kwargs):
577 580
        context = super(UnlinkView, self).get_context_data(**kwargs)
578
-