@opengovsg/mockpass 4.0.0 → 4.0.2
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 +4 -1
- 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,6 +151,7 @@ function config(app, { showLoginPage, serviceProvider }) {
|
|
|
151
151
|
data[name] = myInfoFields[index]
|
|
152
152
|
})
|
|
153
153
|
data['myinfo.nric_number'] = encryptedNric
|
|
154
|
+
data['openid'] = uuid
|
|
154
155
|
const encryptionKey = await jose.JWK.asKey(serviceProvider.pubKey, 'pem')
|
|
155
156
|
|
|
156
157
|
const plaintextPayloadKey = JSON.stringify(payloadKey.toJSON(true))
|
|
@@ -235,6 +236,8 @@ const concatMyInfoRegAddr = (regadd) => {
|
|
|
235
236
|
const sgIDScopeToMyInfoField = (persona, scope) => {
|
|
236
237
|
switch (scope) {
|
|
237
238
|
// No NRIC as that is always returned by default
|
|
239
|
+
case 'openid':
|
|
240
|
+
return persona.uuid.value
|
|
238
241
|
case 'myinfo.name':
|
|
239
242
|
return persona.name.value
|
|
240
243
|
case 'myinfo.email':
|