fix https

This commit is contained in:
Cayo Puigdefabregas 2024-04-02 13:24:55 +02:00
parent 2283f20ab2
commit 2a7a10178c
1 changed files with 13 additions and 3 deletions

View File

@ -141,8 +141,12 @@ class SelectInventoryView(GenericMixin):
# url += f"response_uri=https://{host}/allow_code_oidc4vp"
# url += "&state=1700822573400&response_type=vp_token&response_mode=direct_post"
url = app.config.get('VERIFY_URL')
if host == "localhost":
url += f"?response_uri=http://{host}:5000/allow_code_oidc4vp"
url += '&presentation_definition=["EOperatorClaim"]'
else:
url += f"?response_uri=https://{host}/allow_code_oidc4vp"
url += '&presentation_definition=["EOperatorClaim"]'
session['next_url'] = next
@ -264,7 +268,13 @@ class AllowCodeOidc4vpView(GenericMixin):
db.session.add(code)
db.session.commit()
url = "http://{host}:5000/allow_code_oidc4vp2?code={code}".format(
host = app.config.get('HOST')
if host == "localhost":
url_init = "http://{host}:5000/allow_code_oidc4vp2?code={code}"
else:
url_init = "https://{host}/allow_code_oidc4vp2?code={code}"
url = url_init.format(
host=app.config.get('HOST'),
code=code.code
)