diff --git a/oidc4vp/templates/received_code.html b/oidc4vp/templates/received_code.html new file mode 100644 index 0000000..dc03976 --- /dev/null +++ b/oidc4vp/templates/received_code.html @@ -0,0 +1,72 @@ + +{% load i18n static %} + + + + + + + + + + {% block title %}{% if title %}{{ title }} – {% endif %}Pangea{% endblock %} + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+
+
+ {% trans 'Thank you, we are received your presentation correctly.' %} +
+
+
+
+ +
+
+ +
+
+
+ + diff --git a/oidc4vp/urls.py b/oidc4vp/urls.py index d7b79be..ccef7af 100644 --- a/oidc4vp/urls.py +++ b/oidc4vp/urls.py @@ -13,4 +13,6 @@ urlpatterns = [ name="authorize"), path('allow_code', views.AllowCodeView.as_view(), name="allow_code"), + path('received_code', views.ReceivedCodeView.as_view(), + name="received_code"), ] diff --git a/oidc4vp/views.py b/oidc4vp/views.py index 359a638..851c652 100644 --- a/oidc4vp/views.py +++ b/oidc4vp/views.py @@ -235,7 +235,17 @@ class AllowCodeView(View): promotion = self.authorization.promotions.first() if not promotion: - raise Http404("Page not Found!") + return redirect(reverse_lazy('oidc4vp:received_code')) return redirect(promotion.get_url(code)) + +class ReceivedCodeView(View): + template_name = "received_code.html" + + def get(self, request, *args, **kwargs): + self.context = {} + template = loader.get_template( + self.template_name, + ).render() + return HttpResponse(template)