@hemia/auth-sdk 0.0.18 → 0.0.19
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.
|
@@ -325,7 +325,7 @@ let AuthService = class AuthService {
|
|
|
325
325
|
*/
|
|
326
326
|
async decodeIdToken(idToken) {
|
|
327
327
|
try {
|
|
328
|
-
const decode = this.jwtManager.decode(idToken);
|
|
328
|
+
const decode = this.jwtManager.decode(idToken, true);
|
|
329
329
|
if (!decode) {
|
|
330
330
|
return null;
|
|
331
331
|
}
|
|
@@ -336,12 +336,13 @@ let AuthService = class AuthService {
|
|
|
336
336
|
family_name: decode.payload.family_name,
|
|
337
337
|
picture: decode.payload.picture,
|
|
338
338
|
context: {
|
|
339
|
-
...decode.payload['https://hemia.mx/context']
|
|
339
|
+
...(decode.payload['https://hemia.mx/context'] || {})
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
342
|
return data;
|
|
343
343
|
}
|
|
344
344
|
catch (error) {
|
|
345
|
+
console.log('[decodeIdToken] ID Token Decode Error:', error);
|
|
345
346
|
throw new Error('Failed to decode ID token');
|
|
346
347
|
}
|
|
347
348
|
}
|
package/dist/hemia-auth-sdk.js
CHANGED
|
@@ -327,7 +327,7 @@ exports.AuthService = class AuthService {
|
|
|
327
327
|
*/
|
|
328
328
|
async decodeIdToken(idToken) {
|
|
329
329
|
try {
|
|
330
|
-
const decode = this.jwtManager.decode(idToken);
|
|
330
|
+
const decode = this.jwtManager.decode(idToken, true);
|
|
331
331
|
if (!decode) {
|
|
332
332
|
return null;
|
|
333
333
|
}
|
|
@@ -338,12 +338,13 @@ exports.AuthService = class AuthService {
|
|
|
338
338
|
family_name: decode.payload.family_name,
|
|
339
339
|
picture: decode.payload.picture,
|
|
340
340
|
context: {
|
|
341
|
-
...decode.payload['https://hemia.mx/context']
|
|
341
|
+
...(decode.payload['https://hemia.mx/context'] || {})
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
return data;
|
|
345
345
|
}
|
|
346
346
|
catch (error) {
|
|
347
|
+
console.log('[decodeIdToken] ID Token Decode Error:', error);
|
|
347
348
|
throw new Error('Failed to decode ID token');
|
|
348
349
|
}
|
|
349
350
|
}
|