Projet

Général

Profil

0001-auth_fc-do-not-resolve-next-url-42822.patch

Benjamin Dauvergne, 15 mai 2020 17:21

Télécharger (1,53 ko)

Voir les différences:

Subject: [PATCH] auth_fc: do not resolve next url (#42822)

 src/authentic2_auth_fc/views.py | 2 +-
 tests/auth_fc/test_auth_fc.py   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
src/authentic2_auth_fc/views.py
188 188
                      {'redirect_to': next_url})
189 189

  
190 190
    def simple_redirect(self, request, next_url, *args, **kwargs):
191
        return a2_utils.redirect(request, next_url, *args, **kwargs)
191
        return a2_utils.redirect(request, next_url, *args, resolve=False, **kwargs)
192 192

  
193 193
    def redirect(self, request, *args, **kwargs):
194 194
        next_url = kwargs.pop('next_url', None)
tests/auth_fc/test_auth_fc.py
641 641
    assert path(response['Location']) == '/accounts/'
642 642
    response = response.follow()
643 643
    assert len(response.pyquery('[href*="password/change"]')) > 0
644

  
645

  
646
def test_invalid_next_url(app, fc_settings, caplog, hooks):
647
    assert app.get('/fc/callback/?code=coin&next=JJJ72QQQ').location == 'JJJ72QQQ'
644
-