deploy: update habadashi_login
Browse files7 unmodified lines891011121314151617181920212223154 unmodified lines17817918017117218118218316 unmodified lines200201202195203204205129 unmodified lines3353363373313323333387 unmodified linesimport sysimport timeimport tracebackimport logging
class _SuppressGet200Filter(logging.Filter): def filter(self, record): msg = record.getMessage() if '"GET ' in msg and '" 200' in msg: return False return True
logging.getLogger("uvicorn.access").addFilter(_SuppressGet200Filter())from pathlib import Pathfrom fastapi import FastAPI, Request, Depends, HTTPExceptionfrom fastapi.responses import RedirectResponse, JSONResponse154 unmodified lines """Verify token from cookie and fetch user profile""" token = request.cookies.get("sb_access_token")
print(f"[AUTH_CHECK] Token present: {bool(token)}")
if not token: return None 16 unmodified lines "org_name": (profile_data.get("organizations") or {}).get("name") } print(f"[AUTH_CHECK] Success: user={user_dict['email']} role={user_dict['role']}") return user_dict except Exception as e:129 unmodified lines import uvicorn port = int(os.environ.get("PORT", 7860)) print(f"[ENTRYPOINT] Starting uvicorn on 0.0.0.0:{port}") log_config = uvicorn.config.LOGGING_CONFIG.copy() log_config["loggers"]["uvicorn.access"]["level"] = "WARNING" uvicorn.run(app, host="0.0.0.0", port=port, log_level="info", log_config=log_config) uvicorn.run(app, host="0.0.0.0", port=port, log_level="info")app.py+11-6