fix: local cookie generation on legacy app

Signed-off-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Camila Belo
2024-03-11 15:06:58 +01:00
parent a57f830fe9
commit a846c6fd2a
@@ -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() });
});