diff --git a/.changeset/eighty-apricots-kneel.md b/.changeset/eighty-apricots-kneel.md new file mode 100644 index 0000000000..a9cabaf378 --- /dev/null +++ b/.changeset/eighty-apricots-kneel.md @@ -0,0 +1,5 @@ +--- +'@techdocs/cli': patch +--- + +Fix cookie endpoint mock for `serve` diff --git a/packages/techdocs-cli/src/lib/httpServer.ts b/packages/techdocs-cli/src/lib/httpServer.ts index 252004c7de..c38bc86d7a 100644 --- a/packages/techdocs-cli/src/lib/httpServer.ts +++ b/packages/techdocs-cli/src/lib/httpServer.ts @@ -62,7 +62,7 @@ export default class HTTPServer { // This endpoind is used by the frontend to issue a cookie for the user. // But the MkDocs server doesn't expose it as a the Backestage backend does. // So we need to fake it here to prevent 404 errors. - if (request.url === '/api/techdocs/cookie') { + if (request.url === '/api/techdocs/.backstage/auth/v1/cookie') { const oneHourInMilliseconds = 60 * 60 * 1000; const expiresAt = new Date(Date.now() + oneHourInMilliseconds); const cookie = { expiresAt: expiresAt.toISOString() };