This commit is contained in:
Cayo Puigdefabregas 2023-12-11 15:38:16 +01:00
parent 6cf77c55db
commit de3819b234
2 changed files with 5 additions and 2 deletions

View File

@ -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()

View File

@ -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!")