diff --git a/app/main.py b/app/main.py index 1d6697af..d255c451 100644 --- a/app/main.py +++ b/app/main.py @@ -20,10 +20,6 @@ from app.api import router as api_router from app.frontend import router as frontend_router from app.auth import router as auth_router -BASE_DIR = Path(__file__).resolve().parent # this is /app in many Docker setups -FRONTEND_DIR = BASE_DIR / "frontend" - - # Load configuration from .env for the session key config = Config(".env") @@ -173,7 +169,7 @@ async def ui_upload(file: UploadFile = File(...)): @app.exception_handler(404) async def custom_404_handler(request: Request, exc: HTTPException): return FileResponse( - FRONTEND_DIR / "404.html", + "/app/frontend/404.html", status_code=status.HTTP_404_NOT_FOUND ) diff --git a/frontend/404.html b/frontend/404.html index d953dd52..c085430d 100644 --- a/frontend/404.html +++ b/frontend/404.html @@ -50,27 +50,44 @@ - - + + diff --git a/frontend/about.html b/frontend/about.html index eb2d4658..718b8513 100644 --- a/frontend/about.html +++ b/frontend/about.html @@ -65,7 +65,7 @@

Meet the Creator

- DocuNova is passionately developed by Christian Krakau-Louis, a visionary committed to solving real-world challenges with innovative technology. His dedication and expertise ensure that every feature in DocuNova is crafted with you in mind. + DocuNova is passionately developed by Christian Krakau-Louis, a visionary committed to solving real-world challenges with innovative technology. His dedication and expertise ensure that every feature in DocuNova is crafted with you in mind.

@@ -89,27 +89,44 @@ - - + + diff --git a/frontend/upload.html b/frontend/upload.html index d03e3bd0..eec9ca34 100644 --- a/frontend/upload.html +++ b/frontend/upload.html @@ -114,17 +114,35 @@ } } - // Dynamic auth check using /api/whoami + + (async function checkAuth() { try { const resp = await fetch("/api/whoami"); if (resp.ok) { const data = await resp.json(); - document.getElementById("authSection").innerHTML = ` - User Avatar - Logged in as ${data.email} - Logout - `; + // data.picture is expected to be a Gravatar URL + const authSection = document.getElementById("authSection"); + authSection.innerHTML = ''; + + const img = document.createElement('img'); + img.src = data.picture; + img.alt = 'User Avatar'; + img.className = 'inline-block h-8 w-8 rounded-full mr-2'; + + const textNode = document.createTextNode('Logged in as '); + const strong = document.createElement('strong'); + strong.textContent = data.email; + + const logoutLink = document.createElement('a'); + logoutLink.href = '/logout'; + logoutLink.className = 'ml-4 text-blue-600 hover:text-blue-800'; + logoutLink.textContent = 'Logout'; + + authSection.appendChild(img); + authSection.appendChild(textNode); + authSection.appendChild(strong); + authSection.appendChild(logoutLink); } else { document.getElementById("authSection").innerHTML = `Login`;