{"agent":"codex","input":"A Linear issue labelled auth asks for refresh tokens in this Express API, which signs access tokens with jsonwebtoken. Read package.json, server.js, and everything under app first: config, models, controllers, middleware and routes. Describe how a token is signed and verified today, its lifetime, which header carries it, and what the middleware answers for an expired token versus an invalid one. Install the database server this app is configured for from system packages (no Docker), create the user and database from the config, start the app and exercise sign-up and sign-in on an empty database; report anything that fails before you change code and seed whatever is needed in your test database only. Implement refresh tokens as opaque random values stored hashed in their own table with an owner, expiry and revocation time; rotate on every use; treat reuse of a rotated token as compromise and revoke that user's other refresh tokens; add a refresh route and a sign-out route; make the access and refresh lifetimes config values and keep the current access lifetime as the default unless the issue names another. Make the verify middleware answer an expired access token with a distinct, documented error code while keeping the status. Check how this app applies schema changes and choose a storage design that works with it without altering existing tables. Do not move the signing secret or change existing response fields. Add tests that run against the real database: expiry with a short lifetime, a normal refresh, reuse of a rotated token, an unknown token and sign-out. Open a pull request with the request and response of each new route, the test output, and the findings you did not fix.","resources":[{"url":"https://github.com/your-org/your-app"}]}