From 0ea5db02e8967ea471f107dbdbe9fa9fb782b34b Mon Sep 17 00:00:00 2001 From: immortalcodes <21112002mj@gmail.com> Date: Fri, 20 Sep 2024 12:12:47 +0530 Subject: [PATCH] added new var in env file and sso login for the endpoint --- .env | 1 + webapp/views.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 3083da4..efb7143 100644 --- a/.env +++ b/.env @@ -9,3 +9,4 @@ OS_AUTH_URL=http://localhost:8080/auth/v1.0 OS_USERNAME=test:tester OS_PASSWORD=testing OS_AUTH_VERSION=1.0 +DIRECTORY_API_TOKEN=ADD_DIRECTORY_API_TOKEN_HERE diff --git a/webapp/views.py b/webapp/views.py index 90028e2..c8c16d9 100644 --- a/webapp/views.py +++ b/webapp/views.py @@ -22,6 +22,7 @@ # Local from webapp.database import db_session from webapp.decorators import token_required +from webapp.sso import login_required from webapp.lib.file_helpers import get_mimetype, remove_filename_hash from webapp.lib.http_helpers import set_headers_for_type from webapp.lib.processors import ImageProcessor @@ -377,7 +378,7 @@ def delete_redirect(redirect_path): return jsonify({}), 204 -@token_required +@login_required def get_users(username: str): query = """ query($name: String!) {