@opengovsg/mockpass 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/express/sgid.js +3 -2
- package/package.json +1 -1
package/lib/express/sgid.js
CHANGED
|
@@ -138,7 +138,7 @@ function config(app, { showLoginPage, serviceProvider }) {
|
|
|
138
138
|
const encryptedNric = await encryptPayload(nric)
|
|
139
139
|
const scopesArr = scopes
|
|
140
140
|
.split(' ')
|
|
141
|
-
.filter((field) => field !== '
|
|
141
|
+
.filter((field) => field !== 'myinfo.nric_number')
|
|
142
142
|
console.info(`userinfo scopesArr ${scopesArr}`)
|
|
143
143
|
const myInfoFields = await Promise.all(
|
|
144
144
|
scopesArr.map((scope) =>
|
|
@@ -151,7 +151,6 @@ function config(app, { showLoginPage, serviceProvider }) {
|
|
|
151
151
|
data[name] = myInfoFields[index]
|
|
152
152
|
})
|
|
153
153
|
data['myinfo.nric_number'] = encryptedNric
|
|
154
|
-
data['openid'] = uuid
|
|
155
154
|
const encryptionKey = await jose.JWK.asKey(serviceProvider.pubKey, 'pem')
|
|
156
155
|
|
|
157
156
|
const plaintextPayloadKey = JSON.stringify(payloadKey.toJSON(true))
|
|
@@ -236,6 +235,8 @@ const concatMyInfoRegAddr = (regadd) => {
|
|
|
236
235
|
const sgIDScopeToMyInfoField = (persona, scope) => {
|
|
237
236
|
switch (scope) {
|
|
238
237
|
// No NRIC as that is always returned by default
|
|
238
|
+
case 'openid':
|
|
239
|
+
return persona.uuid.value
|
|
239
240
|
case 'myinfo.name':
|
|
240
241
|
return persona.name.value
|
|
241
242
|
case 'myinfo.email':
|