fix(techdocs-cli): fix serve cmd with proper cookie endpoint mock
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@techdocs/cli': patch
|
||||
---
|
||||
|
||||
Fix cookie endpoint mock for `serve`
|
||||
@@ -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() };
|
||||
|
||||
Reference in New Issue
Block a user