From 27c56a9204945a75d2ceba9729a671cdb1e5f644 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Sun, 21 Jan 2024 11:35:24 +0100 Subject: [PATCH] refactor pilots --- oidc4vp/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oidc4vp/models.py b/oidc4vp/models.py index 66ceff1..42b0d93 100644 --- a/oidc4vp/models.py +++ b/oidc4vp/models.py @@ -193,10 +193,15 @@ class OAuth2VPToken(models.Model): return response response["verify"] = "Ok, Verification correct" - response["redirect_uri"] = self.get_redirect_url() + url = self.get_redirect_url() + if url: + response["redirect_uri"] = url return response def get_redirect_url(self): + if not settings.ALLOW_CODE_URI: + return + data = { "code": self.authorization.code, }