@inrupt/solid-client-authn-browser 2.1.0 → 2.2.1
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/dist/Session.d.ts +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -5
- package/dist/index.mjs.map +1 -1
- package/dist/solid-client-authn.bundle.js +5 -5
- package/dist/solid-client-authn.bundle.js.map +1 -1
- package/package.json +5 -5
- package/src/ClientAuthentication.spec.ts +1 -0
- package/src/ClientAuthentication.ts +5 -1
- package/src/Session.ts +1 -1
- package/src/login/oidc/refresh/TokenRefresher.spec.ts +21 -0
- package/src/login/oidc/refresh/TokenRefresher.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inrupt/solid-client-authn-browser",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"build-docs-preview-site": "npm run build-api-docs; cd docs/api; make html"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@types/node": "^20.
|
|
28
|
+
"@types/node": "^20.14.0",
|
|
29
29
|
"@types/uuid": "^9.0.8"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@inrupt/oidc-client-ext": "^2.1
|
|
33
|
-
"@inrupt/solid-client-authn-core": "^2.1
|
|
32
|
+
"@inrupt/oidc-client-ext": "^2.2.1",
|
|
33
|
+
"@inrupt/solid-client-authn-core": "^2.2.1",
|
|
34
34
|
"events": "^3.3.0",
|
|
35
35
|
"jose": "^5.1.3",
|
|
36
36
|
"uuid": "^9.0.1"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "f8a7a135da9896beea3c16aa1e6a99fccfdf1e08"
|
|
42
42
|
}
|
|
@@ -101,7 +101,11 @@ export default class ClientAuthentication extends ClientAuthenticationBase {
|
|
|
101
101
|
eventEmitter: EventEmitter,
|
|
102
102
|
): Promise<ISessionInfo | undefined> => {
|
|
103
103
|
try {
|
|
104
|
-
const redirectInfo = await this.redirectHandler.handle(
|
|
104
|
+
const redirectInfo = await this.redirectHandler.handle(
|
|
105
|
+
url,
|
|
106
|
+
eventEmitter,
|
|
107
|
+
undefined,
|
|
108
|
+
);
|
|
105
109
|
// The `FallbackRedirectHandler` directly returns the global `fetch` for
|
|
106
110
|
// his value, so we should ensure it's bound to `window` rather than to
|
|
107
111
|
// ClientAuthentication, to avoid the following error:
|
package/src/Session.ts
CHANGED
|
@@ -115,7 +115,7 @@ function isLoggedIn(
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
* A {@link Session} object represents a user's session on an application. The session holds state, as it stores information enabling
|
|
118
|
+
* A {@link Session} object represents a user's session on an application. The session holds state, as it stores information enabling access to private resources after login for instance.
|
|
119
119
|
*/
|
|
120
120
|
export class Session implements IHasSessionEventListener {
|
|
121
121
|
/**
|
|
@@ -272,5 +272,26 @@ describe("TokenRefresher", () => {
|
|
|
272
272
|
);
|
|
273
273
|
expect(result.refreshToken).toBe("Some rotated refresh token");
|
|
274
274
|
});
|
|
275
|
+
|
|
276
|
+
it("does not store the rotated refresh token", async () => {
|
|
277
|
+
const mockedStorage = mockRefresherDefaultStorageUtility();
|
|
278
|
+
await mockOidcModule({
|
|
279
|
+
...mockDpopTokens(),
|
|
280
|
+
refreshToken: "Some rotated refresh token",
|
|
281
|
+
dpopKey: await mockKeyPair(),
|
|
282
|
+
webId: mockWebId(),
|
|
283
|
+
});
|
|
284
|
+
const refresher = getTokenRefresher({
|
|
285
|
+
storageUtility: mockedStorage,
|
|
286
|
+
});
|
|
287
|
+
await refresher.refresh(
|
|
288
|
+
"mySession",
|
|
289
|
+
"some refresh token",
|
|
290
|
+
await mockKeyPair(),
|
|
291
|
+
);
|
|
292
|
+
await expect(
|
|
293
|
+
mockedStorage.getForUser("mySession", "refreshToken"),
|
|
294
|
+
).resolves.toBeUndefined();
|
|
295
|
+
});
|
|
275
296
|
});
|
|
276
297
|
});
|
|
@@ -97,9 +97,6 @@ export default class TokenRefresher implements ITokenRefresher {
|
|
|
97
97
|
|
|
98
98
|
if (tokenSet.refreshToken !== undefined) {
|
|
99
99
|
eventEmitter?.emit(EVENTS.NEW_REFRESH_TOKEN, tokenSet.refreshToken);
|
|
100
|
-
await this.storageUtility.setForUser(sessionId, {
|
|
101
|
-
refreshToken: tokenSet.refreshToken,
|
|
102
|
-
});
|
|
103
100
|
}
|
|
104
101
|
return tokenSet;
|
|
105
102
|
}
|