fix(techdocs-cli): fix serve cmd with proper cookie endpoint mock

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2024-04-18 22:56:53 -04:00
parent 3b4eae38ad
commit 1a0e009502
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@techdocs/cli': patch
---
Fix cookie endpoint mock for `serve`
+1 -1
View File
@@ -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() };