Merge pull request #24368 from kuangp/fix/techdocs-cli

fix(techdocs-cli): fix serve cmd with proper cookie endpoint mock
This commit is contained in:
Fredrik Adelöw
2024-04-22 19:15:34 +02:00
committed by GitHub
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() };