From 31f21e71486c77f6eeefec5fb6ec983dfb317349 Mon Sep 17 00:00:00 2001 From: LoneRifle Date: Mon, 22 May 2023 08:38:00 +0800 Subject: [PATCH] fix: remove openid scope, not offered (#546) --- lib/express/sgid.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/express/sgid.js b/lib/express/sgid.js index cd41669c..2d6a4ace 100644 --- a/lib/express/sgid.js +++ b/lib/express/sgid.js @@ -136,9 +136,10 @@ function config(app, { showLoginPage, serviceProvider }) { .final() } const encryptedNric = await encryptPayload(nric) + // sgID doesn't actually offer the openid scope yet const scopesArr = scopes .split(' ') - .filter((field) => field !== 'myinfo.nric_number') + .filter((field) => field !== 'openid' && field !== 'myinfo.nric_number') console.info(`userinfo scopesArr ${scopesArr}`) const myInfoFields = await Promise.all( scopesArr.map((scope) =>