From a846c6fd2a8d259c8b241098e03655eb36852233 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Mon, 11 Mar 2024 15:06:58 +0100 Subject: [PATCH] fix: local cookie generation on legacy app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Camila Belo Co-authored-by: Fredrik Adelöw --- plugins/techdocs-backend/src/service/router.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index 6db3b8e060..3a2eb4eee6 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -323,12 +323,8 @@ export async function createRouter( router.use('/static/docs', publisher.docsRouter()); // Endpoint that sets the cookie for the user - router.get('/cookie', async (req, res) => { - const credentials = await httpAuth.credentials(req, { - allow: ['user'], - allowLimitedAccess: true, - }); - const { expiresAt } = await httpAuth.issueUserCookie(res, { credentials }); + router.get('/cookie', async (_, res) => { + const { expiresAt } = await httpAuth.issueUserCookie(res); res.json({ expiresAt: expiresAt.toISOString() }); });