From 1392e1ea6b9b01193cdaeea3f95ddc79b71a939e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Vescera?= Date: Tue, 1 Oct 2024 18:05:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20redirect=20url=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.py | 2 ++ src/config.py | 1 + src/routes.py | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index 8584b4c..e4d193e 100644 --- a/src/app.py +++ b/src/app.py @@ -42,6 +42,8 @@ app.logger.debug(f"Setting secret key: {app.config['SECRET_KEY']}") app.secret_key = app.config['SECRET_KEY'] +app.public_url = app.config['WEB_PUBLIC_URL'] + app.logger.debug("Setting REDIS ip and password: %s %s", app.config['REDIS_IP'], app.config['REDIS_PASSWORD']) app.redis_ip = app.config['REDIS_IP'] app.redis_password = app.config['REDIS_PASSWORD'] diff --git a/src/config.py b/src/config.py index 63ff956..c529d3f 100644 --- a/src/config.py +++ b/src/config.py @@ -7,6 +7,7 @@ VAULT_CLIENT_ID = os.getenv('VAULT_CLIENT_ID') VAULT_CLIENT_SECRET = os.getenv('VAULT_CLIENT_SECRET') VAULT_CONF_URL = os.getenv('VAULT_CONF_URL') +WEB_PUBLIC_URL = os.getenv('WEB_PUBLIC_URL') SECRET_KEY = os.getenv('SECRET_KEY') ADMIN_USERS = json.loads(os.getenv('ADMIN_USERS')) REDIS_IP = os.getenv('REDIS_IP') diff --git a/src/routes.py b/src/routes.py index f0106df..ff6c8d7 100644 --- a/src/routes.py +++ b/src/routes.py @@ -50,7 +50,8 @@ def homepage(): @app.route('/login') def login(): app.logger.debug('Redirecting to Vault') - redirect_uri = url_for('auth', _external=True) + # redirect_uri = url_for('auth', _external=True) + redirect_uri = f"{app.public_url}/auth" return oauth.vault.authorize_redirect(redirect_uri)