From de3819b2347912c94a2f8691e4207264412ba931 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 11 Dec 2023 15:38:16 +0100 Subject: [PATCH] fixing --- idhub/management/commands/initial_datas.py | 2 ++ oidc4vp/views.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/idhub/management/commands/initial_datas.py b/idhub/management/commands/initial_datas.py index fa9feb3..cc45eec 100644 --- a/idhub/management/commands/initial_datas.py +++ b/idhub/management/commands/initial_datas.py @@ -52,3 +52,5 @@ class Command(BaseCommand): org2.my_client_secret = org1.client_secret org1.my_client_id = org2.client_id org1.my_client_secret = org2.client_secret + org1.save() + org2.save() diff --git a/oidc4vp/views.py b/oidc4vp/views.py index dbdac7d..ea592d4 100644 --- a/oidc4vp/views.py +++ b/oidc4vp/views.py @@ -11,7 +11,7 @@ from django.utils.translation import gettext_lazy as _ from django.urls import reverse_lazy from django.contrib import messages -from oidc4vp.models import Authorization, Organization +from oidc4vp.models import Authorization, Organization, OAuth2VPToken from idhub.mixins import UserView from oidc4vp.forms import AuthorizeForm @@ -34,13 +34,13 @@ class AuthorizeView(UserView, FormView): vps = json.loads(self.request.GET.get('presentation_definition')) except: vps = [] - # import pdb; pdb.set_trace() kwargs['presentation_definition'] = vps kwargs["org"] = self.get_org() kwargs["code"] = self.request.GET.get('code') return kwargs def form_valid(self, form): + # import pdb; pdb.set_trace() authorization = form.save() if not authorization or authorization.status_code != 200: messages.error(self.request, _("Error sending credential!")) @@ -67,6 +67,7 @@ class AuthorizeView(UserView, FormView): return super().form_valid(form) def get_org(self): + # import pdb; pdb.set_trace() client_id = self.request.GET.get("client_id") if not client_id: raise Http404("Organization not found!")