@itwin/service-authorization
Advanced tools
Comparing version 0.6.1 to 0.6.2
# Change Log - @itwin/service-authorization | ||
This log was last generated on Tue, 25 Jan 2022 15:34:41 GMT and should not be manually modified. | ||
This log was last generated on Mon, 21 Mar 2022 12:23:06 GMT and should not be manually modified. | ||
## 0.6.2 | ||
Mon, 21 Mar 2022 12:23:06 GMT | ||
### Patches | ||
- Cast to resolve type error between union type | ||
- Update token handling to provide better error message when an empty string or invalid token format is provided. | ||
## 0.6.1 | ||
@@ -6,0 +14,0 @@ Tue, 25 Jan 2022 15:34:41 GMT |
@@ -17,3 +17,6 @@ "use strict"; | ||
function removeAccessTokenPrefix(accessToken) { | ||
return accessToken.substr(accessToken.indexOf(" ") + 1); | ||
const splitAccessToken = accessToken.split(" "); | ||
if (splitAccessToken.length !== 2) | ||
throw new core_bentley_1.BentleyError(core_bentley_1.BentleyStatus.ERROR, "Failed to decode JWT"); | ||
return splitAccessToken[1]; | ||
} | ||
@@ -66,3 +69,3 @@ /** @alpha */ | ||
async validateToken(accessToken) { | ||
const decoded = jwt.decode(accessToken, { complete: true }); | ||
const decoded = jwt.decode(accessToken, { complete: true, json: true }); | ||
if (!decoded) | ||
@@ -69,0 +72,0 @@ throw new Error("Failed to decode JWT"); |
{ | ||
"name": "@itwin/service-authorization", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Service authorization client for iTwin platform", | ||
@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
55441
467