Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions api/routes/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from fastapi.templating import Jinja2Templates
from authlib.common.errors import AuthlibBaseError
from authlib.integrations.starlette_client import OAuth
from jinja2 import Environment, FileSystemLoader, FileSystemBytecodeCache
from jinja2 import Environment, FileSystemLoader, FileSystemBytecodeCache, select_autoescape
from starlette.config import Config

from api.auth.user_management import validate_and_cache_user
Expand All @@ -21,7 +21,7 @@
auth_router = APIRouter()
TEMPLATES_DIR = str((Path(__file__).resolve().parents[1] / "../app/templates").resolve())

TEMPLATES_CACHE_DIR = "./.jinja_cache"
TEMPLATES_CACHE_DIR = "/tmp/jinja_cache"
os.makedirs(TEMPLATES_CACHE_DIR, exist_ok=True) # ✅ ensures the folder exists

templates = Jinja2Templates(
Expand All @@ -31,7 +31,8 @@
directory=TEMPLATES_CACHE_DIR,
pattern="%s.cache"
),
auto_reload=True
auto_reload=True,
autoescape=select_autoescape(['html', 'xml', 'j2'])
)
)

Expand Down
Loading