* Probe /auth/status from frontend to avoid 401 console noise on /user GET /api/v1/user requires auth and returns 401 for anonymous visitors, which the browser logs to console even when JS catches it. Probe /auth/status first (always 200), then fetch /user only when logged in. Stale auth cookies are cleared when status reports "not logged in" to preserve the cleanup-on-probe behaviour previously triggered by /user 401. Closes #1188. * Don't clear auth cookies when /auth/status probe itself fails A transient network/5xx on the /auth/status probe used to fall through into the cookie-clear branch and silently log the user out on the next page load. Distinguish "probe failed" (null) from explicit "not logged in"; only the latter clears JWT/XSRF cookies. Lock the distinction with a negative assertion in the probe-failure test. Also align packages/api prettier config with apps/remark42 (trailingComma: 'es5') so future edits don't sweep unrelated trailing commas into the diff.
@remark42/api
Implementation of API methods for Remark42
Development
- If you don't have
pnpminstalled runnpm i -g pnpm@8 - Install dependencies
pnpm i - Run development mode with
pnpm run dev - Build lib with
pnpm run build - Run tests with
pnpm run test