Implement token management and authentication features with logging

This commit is contained in:
Mabe
2026-08-30 21:42:21 +02:00
parent f697a0aca3
commit 83c288d490
7 changed files with 240 additions and 16 deletions
+16 -5
View File
@@ -2,12 +2,15 @@ import logging
import subprocess
import sys
import os
import api_security as auth
import time
open("api.log", "w").close()
open("app.log", "w").close()
open("api_server.log", "w").close()
try:
os.remove("api.log")
os.remove("api_server.log")
os.remove("app.log")
except Exception as e:
logging.error(e)
#Logging
logging.basicConfig(
filename='app.log', # Log to a file
@@ -37,3 +40,11 @@ cli_process = subprocess.Popen([sys.executable, "cli.py"])
api_process.wait()
cli_process.wait()
# automatic durataion validation check
while True:
time.sleep(300)
try:
auth.check_validaty()
except Exception as e:
logging.info(e)