From 1ed07ad502496d72b2ed0e39006c211a4309f8b3 Mon Sep 17 00:00:00 2001 From: Mathieu Strypsteen Date: Wed, 13 Mar 2024 17:42:46 +0100 Subject: [PATCH] Fix environment variable usage --- backend/controllers/auth/authentication_controller.py | 3 ++- backend/controllers/auth/token_controller.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/controllers/auth/authentication_controller.py b/backend/controllers/auth/authentication_controller.py index d9ffd42e..0f605ee0 100644 --- a/backend/controllers/auth/authentication_controller.py +++ b/backend/controllers/auth/authentication_controller.py @@ -1,3 +1,4 @@ +import os import string from typing import TYPE_CHECKING @@ -13,7 +14,7 @@ if TYPE_CHECKING: from _elementtree import Element -cas_service = "https://localhost:8080/login" +cas_service = os.getenv("CAS_URL", "https://localhost:8080/login") def authenticate_user(session: Session, ticket: str) -> UserDataclass | None: diff --git a/backend/controllers/auth/token_controller.py b/backend/controllers/auth/token_controller.py index 7a07bcd1..c574aa83 100644 --- a/backend/controllers/auth/token_controller.py +++ b/backend/controllers/auth/token_controller.py @@ -6,6 +6,7 @@ from domain.models.UserDataclass import UserDataclass +# Zeker aanpassen in production jwt_secret = os.getenv("JWT_SECRET", "secret")