add basic auth support and few under the hood changes

This commit is contained in:
odysseusmax
2021-06-13 16:31:23 +05:30
parent 9eabc78872
commit 11f33611ae
13 changed files with 144 additions and 141 deletions

View File

@ -55,6 +55,8 @@ authenticated = username and password
SESSION_COOKIE_LIFETIME = int(os.environ.get("SESSION_COOKIE_LIFETIME") or "60")
try:
SECRET_KEY = os.environ["SECRET_KEY"]
if len(SECRET_KEY) != 32:
raise ValueError("SECRET_KEY should be exactly 32 charaters long")
except (KeyError, ValueError):
if authenticated:
traceback.print_exc()