diff --git a/ereuse_devicehub/modules/oidc/views.py b/ereuse_devicehub/modules/oidc/views.py index 33a664fd..2a18b795 100644 --- a/ereuse_devicehub/modules/oidc/views.py +++ b/ereuse_devicehub/modules/oidc/views.py @@ -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') - url += f"?response_uri=http://{host}:5000/allow_code_oidc4vp" - url += '&presentation_definition=["EOperatorClaim"]' + 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 )