diff --git a/app/dot_env b/app/dot_env index 07811f4..9448fa4 100644 --- a/app/dot_env +++ b/app/dot_env @@ -5,3 +5,4 @@ DESTINATION = "/var/invoices/" #DESTINATION = "../invoices/" CHUNK_SIZE =1048576 # = 2 ** 20 = 1MB +TOKEN="ZPOclCF5od59SgW6PLM2" diff --git a/app/main.py b/app/main.py index 2349f22..c247083 100644 --- a/app/main.py +++ b/app/main.py @@ -15,6 +15,7 @@ load_dotenv() SERVICE_URL = os.getenv('SERVICE_URL') DESTINATION = os.getenv('DESTINATION') CHUNK_SIZE = int(os.getenv('CHUNK_SIZE')) +env_TOKEN = os.getenv('TOKEN') log = logging.getLogger(__name__) app = FastAPI() @@ -209,7 +210,7 @@ async def create_qr_code(code_content: Optional[str] = None, token: Optional[str Returns: Response: The QR code image as a Response object with media type "image/png". """ - if token == 'ZPOclCF5od59SgW6PLM2': + if token == env_TOKEN: if code_content: qr_image = make_qrcode(code_content) print("{} : QR Created".format(datetime.datetime.now()))