From acb0de1b199035326116e72de3e8a5800e219c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=20Keskim=C3=A4ki?= Date: Fri, 3 Mar 2023 15:21:43 +0200 Subject: [PATCH] Fix missing shibboleth header --- src/server/middeware/shibboleth.ts | 1 + src/server/routes/faculty.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/middeware/shibboleth.ts b/src/server/middeware/shibboleth.ts index 3b7c02b2..d3f46dec 100644 --- a/src/server/middeware/shibboleth.ts +++ b/src/server/middeware/shibboleth.ts @@ -8,6 +8,7 @@ const headers = [ 'mail', 'preferredlanguage', 'hypersonsisuid', + 'hyGroupCn', ] export default headersMiddleware(headers) diff --git a/src/server/routes/faculty.ts b/src/server/routes/faculty.ts index 706f82ab..01df61f6 100644 --- a/src/server/routes/faculty.ts +++ b/src/server/routes/faculty.ts @@ -28,7 +28,7 @@ facultyRouter.get('/', async (req, res) => { }) facultyRouter.get('/user', async (req: RequestWithUser, res) => { - const { id, iamGroups } = req.user + const { id, iamGroups = [] } = req.user if (!id) return res.send([])