From 95ffd554171827e57caf62ce1149bed1a220388c Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 25 May 2022 10:38:54 +0200 Subject: [PATCH] misc: copy context inherited context in authenticator's login (#65693) --- src/authentic2_auth_oidc/models.py | 2 +- src/authentic2_auth_saml/authenticators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authentic2_auth_oidc/models.py b/src/authentic2_auth_oidc/models.py index feee759b..c313d9e5 100644 --- a/src/authentic2_auth_oidc/models.py +++ b/src/authentic2_auth_oidc/models.py @@ -180,7 +180,7 @@ class OIDCProvider(BaseAuthenticator): return redirect_to_login(request, login_url='oidc-login', kwargs={'pk': self.pk}) def login(self, request, *args, **kwargs): - context = kwargs.get('context', {}) + context = kwargs.get('context', {}).copy() context['provider'] = self context['login_url'] = make_url( 'oidc-login', kwargs={'pk': self.id}, request=request, keep_params=True diff --git a/src/authentic2_auth_saml/authenticators.py b/src/authentic2_auth_saml/authenticators.py index 404b6729..53d7c435 100644 --- a/src/authentic2_auth_saml/authenticators.py +++ b/src/authentic2_auth_saml/authenticators.py @@ -52,7 +52,7 @@ class SAMLAuthenticator(BaseAuthenticator): return redirect_to_login(request) def login(self, request, *args, **kwargs): - context = kwargs.pop('context', {}) + context = kwargs.pop('context', {}).copy() instance_id = kwargs.get('instance_id') submit_name = 'login-%s-%s' % (self.id, instance_id) context['submit_name'] = submit_name -- 2.35.1