Compare commits

...

1 Commits

Author SHA1 Message Date
ca0d7c90a0 login fix
Some checks failed
tests / pytest (3.11) (push) Has been cancelled
tests / pytest (3.13) (push) Has been cancelled
2026-09-25 23:45:56 -05:00
2 changed files with 3 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ dev = [
web = [ web = [
"flask>=3.0", "flask>=3.0",
"gunicorn>=22.0", "gunicorn>=22.0",
"python-dotenv>=1.0",
] ]
gemini = [ gemini = [
"google-genai>=1.0", "google-genai>=1.0",

View File

@@ -153,6 +153,8 @@ def run() -> None:
"""Entry point for `physcom-web` script. Same access rules as production, """Entry point for `physcom-web` script. Same access rules as production,
so localhost shows the public view; without PHYSCOM_ADMIN_TOKEN a one-off so localhost shows the public view; without PHYSCOM_ADMIN_TOKEN a one-off
token is generated and printed for /login.""" token is generated and printed for /login."""
from flask.cli import load_dotenv
load_dotenv()
if not os.environ.get("PHYSCOM_ADMIN_TOKEN"): if not os.environ.get("PHYSCOM_ADMIN_TOKEN"):
os.environ["PHYSCOM_ADMIN_TOKEN"] = secrets.token_urlsafe(16) os.environ["PHYSCOM_ADMIN_TOKEN"] = secrets.token_urlsafe(16)
print(f" * Admin login token (this run only): {os.environ['PHYSCOM_ADMIN_TOKEN']}") print(f" * Admin login token (this run only): {os.environ['PHYSCOM_ADMIN_TOKEN']}")