fix redirect_url next to verify vp

This commit is contained in:
Cayo Puigdefabregas 2024-01-21 13:58:13 +01:00
parent 363944c8fe
commit 9522e92781
1 changed files with 5 additions and 5 deletions

View File

@ -75,15 +75,16 @@ class AuthorizeView(UserView, FormView):
if 'ok' in result.lower(): if 'ok' in result.lower():
messages.success(self.request, msg) messages.success(self.request, msg)
cred = form.credentials.first()
verifier = form.org.name
if cred and verifier:
Event.set_EV_CREDENTIAL_PRESENTED(cred, verifier)
if authorization.get('redirect_uri'): if authorization.get('redirect_uri'):
return redirect(authorization.get('redirect_uri')) return redirect(authorization.get('redirect_uri'))
elif authorization.get('response'): elif authorization.get('response'):
txt = authorization.get('response') txt = authorization.get('response')
messages.success(self.request, txt) messages.success(self.request, txt)
cred = form.credentials.first()
verifier = form.org.name
if cred and verifier:
Event.set_EV_CREDENTIAL_PRESENTED(cred, verifier)
txt2 = f"Verifier {verifier} send: " + txt txt2 = f"Verifier {verifier} send: " + txt
Event.set_EV_USR_SEND_VP(txt2, self.request.user) Event.set_EV_USR_SEND_VP(txt2, self.request.user)
url = reverse_lazy('idhub:user_dashboard') url = reverse_lazy('idhub:user_dashboard')
@ -137,7 +138,6 @@ class VerifyView(View):
response = vp_token.get_response_verify() response = vp_token.get_response_verify()
vp_token.save() vp_token.save()
if not vp_token.authorization.promotions.exists(): if not vp_token.authorization.promotions.exists():
response["redirect_uri"] = ""
response["response"] = "Validation Code {}".format(code) response["response"] = "Validation Code {}".format(code)
return JsonResponse(response) return JsonResponse(response)