From 6dbd5d18a57ef4f43f1ca1123a3fe3d7b8cb5d39 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 25 Mar 2024 13:18:30 +0100 Subject: [PATCH] save in session redirect_uri --- promotion/views.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/promotion/views.py b/promotion/views.py index 2ecac4c..822e7ea 100644 --- a/promotion/views.py +++ b/promotion/views.py @@ -106,6 +106,7 @@ class SelectWalletView(FormView): success_url = reverse_lazy('promotion:select_wallet') def get_form_kwargs(self): + self.get_response_uri() kwargs = super().get_form_kwargs() kwargs['presentation_definition'] = json.dumps(settings.SUPPORTED_CREDENTIALS) return kwargs @@ -114,3 +115,14 @@ class SelectWalletView(FormView): url = form.save() return redirect(url) + def get_response_uri(self): + path = self.request.get_full_path().split("?") + if len(path) < 2: + return + + args = path[1] + response_uri = dict( + [x.split("=") for x in args.split("&")] + ).get('response_uri') + + self.request.session["response_uri"] = response_uri