From ede20c3879dcc5a2caa4ea377bad834e46cb8428 Mon Sep 17 00:00:00 2001 From: Anson He Date: Thu, 2 May 2024 21:41:50 -0400 Subject: [PATCH] fix backend auth role missing optional chaining --- backend/controller/getAuthRoles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/controller/getAuthRoles.js b/backend/controller/getAuthRoles.js index 49fdd94..1fec945 100644 --- a/backend/controller/getAuthRoles.js +++ b/backend/controller/getAuthRoles.js @@ -8,7 +8,7 @@ const getWATIAMFromEmail = async (email) => { const getAuthRoles = async (user_uid, email, reporter_id) => { const watiam = await getWATIAMFromEmail(email) const currentGoogleGroup = await getGoogleGroup(watiam) - const isAdmin = currentGoogleGroup.title === AUTH_ROLES.Administrator + const isAdmin = currentGoogleGroup?.title === AUTH_ROLES.Administrator const isReporter = reporter_id === user_uid return {