save in session redirect_uri

This commit is contained in:
Cayo Puigdefabregas 2024-03-25 13:18:30 +01:00
parent 9dd4cbe748
commit 6dbd5d18a5
1 changed files with 12 additions and 0 deletions

View File

@ -106,6 +106,7 @@ class SelectWalletView(FormView):
success_url = reverse_lazy('promotion:select_wallet') success_url = reverse_lazy('promotion:select_wallet')
def get_form_kwargs(self): def get_form_kwargs(self):
self.get_response_uri()
kwargs = super().get_form_kwargs() kwargs = super().get_form_kwargs()
kwargs['presentation_definition'] = json.dumps(settings.SUPPORTED_CREDENTIALS) kwargs['presentation_definition'] = json.dumps(settings.SUPPORTED_CREDENTIALS)
return kwargs return kwargs
@ -114,3 +115,14 @@ class SelectWalletView(FormView):
url = form.save() url = form.save()
return redirect(url) 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