Fix 401 on poll-status: remove auth requirement from read-only status endpoint

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/15d037ef-2d5e-44ab-a15d-7908187e9106

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-29 23:43:54 +00:00
parent 4d77af791c
commit dfef73040c
2 changed files with 6 additions and 5 deletions
+2 -5
View File
@@ -583,14 +583,11 @@ async def trigger_imap_poll(auth: dict = Depends(require_admin_auth)):
# API endpoint to check status of IMAP polling
@app.get("/api/v1/admin/poll-status")
async def get_poll_status(auth: dict = Depends(require_admin_auth)):
async def get_poll_status():
"""
Get the status of IMAP polling (admin only - requires authentication)
Security: Requires either X-API-Key header or Bearer token
Get the status of IMAP polling (read-only, no authentication required).
"""
return {
"is_running": background_task is not None and not background_task.done(),
"last_check": last_check_time.isoformat() if last_check_time else None,
"authenticated_by": auth.get("auth_type"),
}
+4
View File
@@ -200,6 +200,10 @@ function dashboardApp() {
async getImapStatus() {
try {
const response = await fetch('/api/v1/admin/poll-status');
if (!response.ok) {
console.error('Error checking IMAP status:', response.status);
return;
}
const data = await response.json();
const statusIcon = document.getElementById('imap-status-icon');