@pnp/azidjsclient 3.14.0 → 3.15.0
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/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PnPClientStorage, getHashCode } from "@pnp/core/index.js";
|
|
2
2
|
export function AzureIdentity(credential, scopes = ["https://graph.microsoft.com/.default"], options) {
|
|
3
|
-
const key = `AzureIdentityCredential${getHashCode(scopes.join())}`;
|
|
3
|
+
const key = `AzureIdentityCredential${Math.abs(getHashCode(scopes.join()))}`;
|
|
4
4
|
const storage = new PnPClientStorage();
|
|
5
5
|
return (instance) => {
|
|
6
6
|
instance.on.auth.replace(async (url, init) => {
|
|
@@ -9,7 +9,7 @@ export function AzureIdentity(credential, scopes = ["https://graph.microsoft.com
|
|
|
9
9
|
const tokenStore = storage.session.get(key);
|
|
10
10
|
if (tokenStore) {
|
|
11
11
|
const storedToken = JSON.parse(tokenStore);
|
|
12
|
-
if (storedToken.expires
|
|
12
|
+
if (new Date(storedToken.expires) > (new Date())) {
|
|
13
13
|
token = storedToken.token;
|
|
14
14
|
}
|
|
15
15
|
}
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/azidjsclient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAgCnE,MAAM,UAAU,aAAa,CAAC,UAA2B,EACrD,SAAmB,CAAC,sCAAsC,CAAC,EAC3D,OAAyB;IAEzB,MAAM,GAAG,GAAG,0BAA0B,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/azidjsclient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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AAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;aACtD;YAED,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC;YAErE,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IACpB,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/azidjsclient",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "pnp - provides an Azure Identity wrapper client for use with PnPjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@pnp/core": "3.
|
|
9
|
-
"@pnp/queryable": "3.
|
|
10
|
-
"@azure/identity": "3.1
|
|
11
|
-
"tslib": "2.
|
|
8
|
+
"@pnp/core": "3.15.0",
|
|
9
|
+
"@pnp/queryable": "3.15.0",
|
|
10
|
+
"@azure/identity": "3.2.1",
|
|
11
|
+
"tslib": "2.5.0"
|
|
12
12
|
},
|
|
13
13
|
"funding": {
|
|
14
14
|
"type": "individual",
|