Projet

Général

Profil

0001-misc-adapt-to-change-in-protocol-for-redirect_logout.patch

Benjamin Dauvergne, 30 septembre 2022 01:22

Télécharger (1,71 ko)

Voir les différences:

Subject: [PATCH] misc: adapt to change in protocol for redirect_logout_list
 (#69739)

 src/authentic2_auth_fedict/__init__.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
src/authentic2_auth_fedict/__init__.py
35 35
                user = kwargs.get('user')
36 36
                user.backend = 'authentic2_auth_fedict.backends.FedictBackend'
37 37

  
38
    def a2_hook_redirect_logout_list(self, request, **kwargs):
39
        from mellon.views import logout
40

  
41
        if 'mellon_session' in request.session:
42
            response = logout(request, next_url='/logout/')
43
            if 'Location' in response:
44
                return [response['Location']]
45
        return []
46

  
38 47

  
39 48
default_app_config = 'authentic2_auth_fedict.AppConfig'
40 49

  
......
52 61
        return ['authentic2_auth_fedict.backends.FedictBackend']
53 62

  
54 63
    def redirect_logout_list(self, request, next_url=None):
64
        # duplicated, should be removed in the future when
65
        # AppConfig.a2_hook_redirect_logout_list is the only one required
55 66
        from mellon.views import logout
56 67

  
57 68
        if 'mellon_session' in request.session:
58
            response = logout(request)
69
            response = logout(request, next_url='/logout/')
59 70
            if 'Location' in response:
60 71
                return [response['Location']]
61 72
        return []
62
-