{"agent":"claude","input":"An issue labelled security asks to stop exposing the JWT to browser JavaScript in this Express API. Read package.json, server.js and everything under app. Report where the token is returned to the client, where it is read back, how CORS is configured (including any headers set by hand in route files), whether anything parses cookies today, and whether a sign-out route exists. Change sign-in to also set the token as a cookie that is httpOnly, has a SameSite value you justify from the origins in the CORS config, is Secure in production, and expires with the token. Make the verify middleware read the cookie first and fall back to the existing header so current clients keep working. Add whatever is needed to parse cookies, enable credentials in CORS without widening the allowed origin, add a sign-out route that clears the cookie with matching attributes, and add an Origin check for state-changing methods. Keep returning the token in the sign-in body behind a config flag that defaults to on, and document the second step that turns it off. Do not change the token's contents, lifetime, signing or the user fields in the response. Install the database server the config expects from system packages (no Docker), create its database, seed what sign-up requires, run the server and verify with real HTTP calls: cookie attributes on sign-in, a protected route with only the cookie, the same route with only the header, the CORS preflight headers, and sign-out. Add those as tests using only what Node provides. Open a pull request with the header dumps, the test output, and a checklist of the changes each front end must make.","resources":[{"url":"https://github.com/your-org/your-app"}]}