@inrupt/solid-client-authn-browser 1.17.5 → 2.1.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.
Files changed (49) hide show
  1. package/dist/ClientAuthentication.d.ts +1 -0
  2. package/dist/Session.d.ts +4 -67
  3. package/dist/defaultSession.d.ts +0 -28
  4. package/dist/dependencies.d.ts +1 -2
  5. package/dist/index.d.ts +2 -3
  6. package/dist/index.js +40 -153
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +34 -143
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/login/oidc/__mocks__/IOidcOptions.d.ts +2 -0
  11. package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.d.ts +4 -0
  12. package/dist/solid-client-authn.bundle.js +19 -19
  13. package/dist/solid-client-authn.bundle.js.map +1 -1
  14. package/package.json +7 -8
  15. package/rollup.config.mjs +28 -14
  16. package/src/ClientAuthentication.spec.ts +1 -13
  17. package/src/Session.spec.ts +11 -178
  18. package/src/Session.ts +6 -98
  19. package/src/defaultSession.spec.ts +0 -18
  20. package/src/defaultSession.ts +0 -40
  21. package/src/dependencies.ts +1 -2
  22. package/src/index.spec.ts +1 -2
  23. package/src/index.ts +9 -3
  24. package/src/login/oidc/ClientRegistrar.spec.ts +9 -9
  25. package/src/login/oidc/ClientRegistrar.ts +15 -8
  26. package/src/login/oidc/IssuerConfigFetcher.spec.ts +17 -32
  27. package/src/login/oidc/IssuerConfigFetcher.ts +1 -5
  28. package/src/login/oidc/OidcLoginHandler.spec.ts +6 -3
  29. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.spec.ts +28 -42
  30. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.ts +18 -34
  31. package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.spec.ts +0 -11
  32. package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.spec.ts +1 -12
  33. package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +1 -0
  34. package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts +1 -2
  35. package/.prettierignore +0 -3
  36. package/sampleFlows/SolidAuthClientArchitecture.png +0 -0
  37. package/sampleFlows/authorization-code-with-pkce.png +0 -0
  38. package/sampleFlows/authorization-code-with-pkce.seqdiag +0 -46
  39. package/sampleFlows/authorization-code.png +0 -0
  40. package/sampleFlows/authorization-code.seqdiag +0 -50
  41. package/sampleFlows/client-credentials.png +0 -0
  42. package/sampleFlows/client-credentials.seqdiag +0 -38
  43. package/sampleFlows/legacy-implicit-flow.png +0 -0
  44. package/sampleFlows/legacy-implicit-flow.seqdiag +0 -43
  45. package/sampleFlows/self-signed.png +0 -0
  46. package/sampleFlows/self-signed.seqdiag +0 -49
  47. package/sampleFlows/signatory-access-control.seqdiag +0 -36
  48. package/sampleFlows/signatory-access-control.svg +0 -1
  49. package/sonar-project.properties +0 -15
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  /**
2
3
  * @hidden
3
4
  * @packageDocumentation
package/dist/Session.d.ts CHANGED
@@ -1,10 +1,7 @@
1
- /// <reference types="node" />
2
1
  /**
3
2
  * @hidden
4
3
  */
5
4
  import type { ILoginInputOptions, ISessionInfo, IStorage, IHasSessionEventListener, ISessionEventListener, ILogoutOptions } from "@inrupt/solid-client-authn-core";
6
- import type { fetch } from "@inrupt/universal-fetch";
7
- import EventEmitter from "events";
8
5
  import type ClientAuthentication from "./ClientAuthentication";
9
6
  export interface ISessionOptions {
10
7
  /**
@@ -33,28 +30,10 @@ export interface IHandleIncomingRedirectOptions {
33
30
  * If your app's access has not expired yet and re-activation completed
34
31
  * successfully, a `sessionRestore` event will be fired with the URL the user
35
32
  * was at before they were redirected to their Solid Identity Provider.
36
- * {@see onSessionRestore}
33
+ * See {@link ISessionEventListener}: a callback can be registered to
34
+ * `session.events.on(EVENTS.SESSION_RESTORED, callback)`.
37
35
  */
38
36
  restorePreviousSession?: boolean;
39
- /**
40
- * Inrupt's Enterprise Solid Server can set a cookie to allow the browser to
41
- * access private resources on a Pod. In order to mitigate the logout-on-refresh
42
- * issue on the short term, the server also implemented a session endpoint
43
- * enabling the client app to know whether the cookie is set. When a user
44
- * logs in to a server that has that capability enabled, applications that set
45
- * this option to `true` will be able to make use of it.
46
- *
47
- * If your app supports the newest session restore approach, and `restorePreviousSession`
48
- * is set to true, this option is automatically set to false, but your app will
49
- * not be logged out when reloaded.
50
- *
51
- * `useEssSession` defaults to false and will be removed in the future; to
52
- * preserve sessions across page reloads, use of `restorePreviousSession` is
53
- * recommended.
54
- *
55
- * @deprecated unreleased
56
- */
57
- useEssSession?: boolean;
58
37
  /**
59
38
  * The URL of the page handling the redirect, including the query
60
39
  * parameters — these contain the information to process the login.
@@ -67,7 +46,7 @@ export declare function silentlyAuthenticate(sessionId: string, clientAuthn: Cli
67
46
  /**
68
47
  * A {@link Session} object represents a user's session on an application. The session holds state, as it stores information enabling acces to private resources after login for instance.
69
48
  */
70
- export declare class Session extends EventEmitter implements IHasSessionEventListener {
49
+ export declare class Session implements IHasSessionEventListener {
71
50
  /**
72
51
  * Information regarding the current session.
73
52
  */
@@ -160,50 +139,8 @@ export declare class Session extends EventEmitter implements IHasSessionEventLis
160
139
  * Completes the login process by processing the information provided by the
161
140
  * Solid identity provider through redirect.
162
141
  *
163
- * @param options See {@see IHandleIncomingRedirectOptions}.
142
+ * @param options See {@link IHandleIncomingRedirectOptions}.
164
143
  */
165
144
  handleIncomingRedirect: (inputOptions?: string | IHandleIncomingRedirectOptions) => Promise<ISessionInfo | undefined>;
166
- /**
167
- * Register a callback function to be called when a user completes login.
168
- *
169
- * The callback is called when {@link handleIncomingRedirect} completes successfully.
170
- *
171
- * @param callback The function called when a user completes login.
172
- * @deprecated Prefer session.events.on(EVENTS.LOGIN, callback)
173
- */
174
- onLogin(callback: () => unknown): void;
175
- /**
176
- * Register a callback function to be called when a user logs out:
177
- *
178
- * @param callback The function called when a user completes logout.
179
- * @deprecated Prefer session.events.on(EVENTS.LOGOUT, callback)
180
- */
181
- onLogout(callback: () => unknown): void;
182
- /**
183
- * Register a callback function to be called when a user logs out:
184
- *
185
- * @param callback The function called when an error occurs.
186
- * @since 1.11.0
187
- * @deprecated Prefer session.events.on(EVENTS.ERROR, callback)
188
- */
189
- onError(callback: (error: string | null, errorDescription?: string | null) => unknown): void;
190
- /**
191
- * Register a callback function to be called when a session is restored.
192
- *
193
- * Note: the callback will be called with the saved value of the 'current URL'
194
- * at the time the session was restored.
195
- *
196
- * @param callback The function called when a user's already logged-in session is restored, e.g., after a silent authentication is completed after a page refresh.
197
- * @deprecated Prefer session.events.on(EVENTS.SESSION_RESTORED, callback)
198
- */
199
- onSessionRestore(callback: (currentUrl: string) => unknown): void;
200
- /**
201
- * Register a callback that runs when the session expires and can no longer
202
- * make authenticated requests, but following a user logout.
203
- * @param callback The function that runs on session expiration.
204
- * @since 1.11.0
205
- * @deprecated Prefer session.events.on(EVENTS.SESSION_EXPIRED, callback)
206
- */
207
- onSessionExpiration(callback: () => unknown): void;
208
145
  private setSessionInfo;
209
146
  }
@@ -44,34 +44,6 @@ export declare const logout: Session["logout"];
44
44
  * @since 1.3.0
45
45
  */
46
46
  export declare const handleIncomingRedirect: Session["handleIncomingRedirect"];
47
- /**
48
- * Register a callback function to be called when a user completes login.
49
- *
50
- * The callback is called when {@link handleIncomingRedirect} completes successfully.
51
- * @since 1.3.0
52
- *
53
- * @param callback The function called when a user completes login.
54
- * @deprecated Prefer events.on(EVENTS.LOGIN, callback)
55
-
56
- */
57
- export declare const onLogin: Session["onLogin"];
58
- /**
59
- * Register a callback function to be called when a user logs out:
60
- *
61
- * @param callback The function called when a user completes logout.
62
- * @since 1.3.0
63
- * @deprecated Prefer events.on(EVENTS.LOGOUT, callback)
64
- *
65
- */
66
- export declare const onLogout: Session["onLogout"];
67
- /**
68
- * Register a callback function to be called when a session is restored:
69
- *
70
- * @param callback The function called when a session is restored.
71
- * @since 1.3.0
72
- * @deprecated Prefer events.on(EVENTS.SESSION_RESTORED, callback)
73
- */
74
- export declare const onSessionRestore: Session["onSessionRestore"];
75
47
  /**
76
48
  * {@link SessionEventEmitter} instance to subscribe to events by the default session.
77
49
  *
@@ -8,9 +8,8 @@
8
8
  import type { IStorage } from "@inrupt/solid-client-authn-core";
9
9
  import ClientAuthentication from "./ClientAuthentication";
10
10
  /**
11
- *
12
11
  * @param dependencies
13
- * @deprecated This function will be removed from the external API in an upcoming release.
12
+ * @hidden
14
13
  */
15
14
  export declare function getClientAuthenticationWithDependencies(dependencies: {
16
15
  secureStorage?: IStorage;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { Session, ISessionOptions } from "./Session";
2
- export { getClientAuthenticationWithDependencies } from "./dependencies";
1
+ export { Session, ISessionOptions, IHandleIncomingRedirectOptions, } from "./Session";
3
2
  export * from "./defaultSession";
4
- export { ILoginInputOptions, ISessionInfo, IStorage, NotImplementedError, ConfigurationError, InMemoryStorage, EVENTS, } from "@inrupt/solid-client-authn-core";
3
+ export { ILoginInputOptions, ISessionInfo, IStorage, NotImplementedError, ConfigurationError, InMemoryStorage, IHasSessionEventListener, ISessionEventListener, IEndSessionOptions, ILogoutOptions, EVENTS, } from "@inrupt/solid-client-authn-core";
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ var solidClientAuthnCore = require('@inrupt/solid-client-authn-core');
4
4
  var uuid = require('uuid');
5
5
  var EventEmitter = require('events');
6
6
  var oidcClientExt = require('@inrupt/oidc-client-ext');
7
- var universalFetch = require('@inrupt/universal-fetch');
8
7
 
9
8
  //
10
9
  // Copyright Inrupt Inc.
@@ -265,8 +264,7 @@ class AuthorizationCodeWithPkceOidcHandler extends solidClientAuthnCore.Authoriz
265
264
  authority: oidcLoginOptions.issuer.toString(),
266
265
  client_id: oidcLoginOptions.client.clientId,
267
266
  client_secret: oidcLoginOptions.client.clientSecret,
268
- redirect_uri: oidcLoginOptions.redirectUrl.toString(),
269
- post_logout_redirect_uri: oidcLoginOptions.redirectUrl.toString(),
267
+ redirect_uri: oidcLoginOptions.redirectUrl,
270
268
  response_type: "code",
271
269
  scope: solidClientAuthnCore.DEFAULT_SCOPES,
272
270
  filterProtocolClaims: true,
@@ -445,7 +443,7 @@ class IssuerConfigFetcher {
445
443
  // Make sure to append a slash at issuer URL, so that the .well-known URL
446
444
  // includes the full issuer path. See https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig.
447
445
  issuer.endsWith("/") ? issuer : `${issuer}/`).href;
448
- const issuerConfigRequestBody = await universalFetch.fetch.call(globalThis, openIdConfigUrl);
446
+ const issuerConfigRequestBody = await fetch(openIdConfigUrl);
449
447
  // Check the validity of the fetched config
450
448
  try {
451
449
  issuerConfig = processConfig(await issuerConfigRequestBody.json());
@@ -627,14 +625,6 @@ class FallbackRedirectHandler {
627
625
  // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
628
626
  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
629
627
  //
630
- /**
631
- * @hidden
632
- * @packageDocumentation
633
- */
634
- // FIXME: The following doesn't work in the browser, it results in all the fetches
635
- // being unauthenticated. This should be looked into when migrating to universal-fetch.
636
- // import { fetch } from "cross-fetch";
637
- const globalFetch = (...args) => universalFetch.fetch.call(globalThis, ...args);
638
628
  /**
639
629
  * @hidden
640
630
  */
@@ -682,25 +672,18 @@ class AuthCodeRedirectHandler {
682
672
  throw new Error(`The redirect URL for session ${storedSessionId} is missing from storage.`);
683
673
  }
684
674
  const client = await this.clientRegistrar.getClient({ sessionId: storedSessionId }, issuerConfig);
685
- let tokens;
686
675
  const tokenCreatedAt = Date.now();
687
- if (isDpop) {
688
- tokens = await oidcClientExt.getDpopToken(issuerConfig, client, {
689
- grantType: "authorization_code",
690
- // We rely on our 'canHandle' function checking that the OAuth 'code'
691
- // parameter is present in our query string.
692
- code: url.searchParams.get("code"),
693
- codeVerifier,
694
- redirectUrl: storedRedirectIri,
695
- });
696
- // Delete oidc-client-specific session information from storage. This is
697
- // done automatically when retrieving a bearer token, but since the DPoP
698
- // binding uses our custom code, this needs to be done manually.
699
- window.localStorage.removeItem(`oidc.${oauthState}`);
700
- }
701
- else {
702
- tokens = await oidcClientExt.getBearerToken(url.toString());
703
- }
676
+ const tokens = await oidcClientExt.getTokens(issuerConfig, client, {
677
+ grantType: "authorization_code",
678
+ // We rely on our 'canHandle' function checking that the OAuth 'code'
679
+ // parameter is present in our query string.
680
+ code: url.searchParams.get("code"),
681
+ codeVerifier,
682
+ redirectUrl: storedRedirectIri,
683
+ }, isDpop);
684
+ // Delete oidc-client-specific session information from storage. oidc-client
685
+ // is no longer used for the token exchange, so it doesn't perform this automatically.
686
+ window.localStorage.removeItem(`oidc.${oauthState}`);
704
687
  let refreshOptions;
705
688
  if (tokens.refreshToken !== undefined) {
706
689
  refreshOptions = {
@@ -709,7 +692,7 @@ class AuthCodeRedirectHandler {
709
692
  tokenRefresher: this.tokerRefresher,
710
693
  };
711
694
  }
712
- const authFetch = await solidClientAuthnCore.buildAuthenticatedFetch(globalFetch, tokens.accessToken, {
695
+ const authFetch = await solidClientAuthnCore.buildAuthenticatedFetch(tokens.accessToken, {
713
696
  dpopKey: tokens.dpopKey,
714
697
  refreshOptions,
715
698
  eventEmitter,
@@ -870,25 +853,27 @@ class ClientRegistrar {
870
853
  }
871
854
  async getClient(options, issuerConfig) {
872
855
  // If client secret and/or client id are stored in storage, use those.
873
- const [storedClientId, storedClientSecret,
874
- // storedClientName,
875
- ] = await Promise.all([
856
+ const [storedClientId, storedClientSecret, storedClientName, storedClientType,] = await Promise.all([
876
857
  this.storageUtility.getForUser(options.sessionId, "clientId", {
877
858
  secure: false,
878
859
  }),
879
860
  this.storageUtility.getForUser(options.sessionId, "clientSecret", {
880
861
  secure: false,
881
862
  }),
882
- // this.storageUtility.getForUser(options.sessionId, "clientName", {
883
- // // FIXME: figure out how to persist secure storage at reload
884
- // secure: false,
885
- // }),
863
+ this.storageUtility.getForUser(options.sessionId, "clientName", {
864
+ secure: false,
865
+ }),
866
+ this.storageUtility.getForUser(options.sessionId, "clientType", {
867
+ secure: false,
868
+ }),
886
869
  ]);
887
- if (storedClientId) {
870
+ if (storedClientId && solidClientAuthnCore.isKnownClientType(storedClientType)) {
888
871
  return {
889
872
  clientId: storedClientId,
890
873
  clientSecret: storedClientSecret,
891
- clientType: "dynamic",
874
+ clientName: storedClientName,
875
+ // Note: static clients are not applicable in a browser context.
876
+ clientType: storedClientType,
892
877
  };
893
878
  }
894
879
  try {
@@ -896,6 +881,7 @@ class ClientRegistrar {
896
881
  // Save info
897
882
  const infoToSave = {
898
883
  clientId: registeredClient.clientId,
884
+ clientType: "dynamic",
899
885
  };
900
886
  if (registeredClient.clientSecret) {
901
887
  infoToSave.clientSecret = registeredClient.clientSecret;
@@ -1043,9 +1029,8 @@ class TokenRefresher {
1043
1029
  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1044
1030
  //
1045
1031
  /**
1046
- *
1047
1032
  * @param dependencies
1048
- * @deprecated This function will be removed from the external API in an upcoming release.
1033
+ * @hidden
1049
1034
  */
1050
1035
  function getClientAuthenticationWithDependencies(dependencies) {
1051
1036
  const inMemoryStorage = new solidClientAuthnCore.InMemoryStorage();
@@ -1140,7 +1125,7 @@ function isLoggedIn(sessionInfo) {
1140
1125
  /**
1141
1126
  * A {@link Session} object represents a user's session on an application. The session holds state, as it stores information enabling acces to private resources after login for instance.
1142
1127
  */
1143
- class Session extends EventEmitter {
1128
+ class Session {
1144
1129
  /**
1145
1130
  * Session object constructor. Typically called as follows:
1146
1131
  *
@@ -1157,7 +1142,6 @@ class Session extends EventEmitter {
1157
1142
  *
1158
1143
  */
1159
1144
  constructor(sessionOptions = {}, sessionId = undefined) {
1160
- super();
1161
1145
  this.tokenRequestInProgress = false;
1162
1146
  /**
1163
1147
  * Triggers the login process. Note that this method will redirect the user away from your app.
@@ -1248,7 +1232,7 @@ class Session extends EventEmitter {
1248
1232
  * Completes the login process by processing the information provided by the
1249
1233
  * Solid identity provider through redirect.
1250
1234
  *
1251
- * @param options See {@see IHandleIncomingRedirectOptions}.
1235
+ * @param options See {@link IHandleIncomingRedirectOptions}.
1252
1236
  */
1253
1237
  this.handleIncomingRedirect = async (inputOptions = {}) => {
1254
1238
  var _a;
@@ -1301,11 +1285,7 @@ class Session extends EventEmitter {
1301
1285
  this.tokenRequestInProgress = false;
1302
1286
  return sessionInfo;
1303
1287
  };
1304
- // Until Session no longer implements EventEmitter, this.events is just a proxy
1305
- // to this (with some interface filtering). When we make the breaking change,
1306
- // this.events will be a regular EventEmitter (implementing ISessionEventEmitter):
1307
- // this.events = new EventEmitter();
1308
- this.events = new Proxy(this, solidClientAuthnCore.buildProxyHandler(Session.prototype, "events only implements ISessionEventListener"));
1288
+ this.events = new EventEmitter();
1309
1289
  if (sessionOptions.clientAuthentication) {
1310
1290
  this.clientAuthentication = sessionOptions.clientAuthentication;
1311
1291
  }
@@ -1339,58 +1319,6 @@ class Session extends EventEmitter {
1339
1319
  this.events.on(solidClientAuthnCore.EVENTS.SESSION_EXPIRED, () => this.internalLogout(false));
1340
1320
  this.events.on(solidClientAuthnCore.EVENTS.ERROR, () => this.internalLogout(false));
1341
1321
  }
1342
- /**
1343
- * Register a callback function to be called when a user completes login.
1344
- *
1345
- * The callback is called when {@link handleIncomingRedirect} completes successfully.
1346
- *
1347
- * @param callback The function called when a user completes login.
1348
- * @deprecated Prefer session.events.on(EVENTS.LOGIN, callback)
1349
- */
1350
- onLogin(callback) {
1351
- this.events.on(solidClientAuthnCore.EVENTS.LOGIN, callback);
1352
- }
1353
- /**
1354
- * Register a callback function to be called when a user logs out:
1355
- *
1356
- * @param callback The function called when a user completes logout.
1357
- * @deprecated Prefer session.events.on(EVENTS.LOGOUT, callback)
1358
- */
1359
- onLogout(callback) {
1360
- this.events.on(solidClientAuthnCore.EVENTS.LOGOUT, callback);
1361
- }
1362
- /**
1363
- * Register a callback function to be called when a user logs out:
1364
- *
1365
- * @param callback The function called when an error occurs.
1366
- * @since 1.11.0
1367
- * @deprecated Prefer session.events.on(EVENTS.ERROR, callback)
1368
- */
1369
- onError(callback) {
1370
- this.events.on(solidClientAuthnCore.EVENTS.ERROR, callback);
1371
- }
1372
- /**
1373
- * Register a callback function to be called when a session is restored.
1374
- *
1375
- * Note: the callback will be called with the saved value of the 'current URL'
1376
- * at the time the session was restored.
1377
- *
1378
- * @param callback The function called when a user's already logged-in session is restored, e.g., after a silent authentication is completed after a page refresh.
1379
- * @deprecated Prefer session.events.on(EVENTS.SESSION_RESTORED, callback)
1380
- */
1381
- onSessionRestore(callback) {
1382
- this.events.on(solidClientAuthnCore.EVENTS.SESSION_RESTORED, callback);
1383
- }
1384
- /**
1385
- * Register a callback that runs when the session expires and can no longer
1386
- * make authenticated requests, but following a user logout.
1387
- * @param callback The function that runs on session expiration.
1388
- * @since 1.11.0
1389
- * @deprecated Prefer session.events.on(EVENTS.SESSION_EXPIRED, callback)
1390
- */
1391
- onSessionExpiration(callback) {
1392
- this.events.on(solidClientAuthnCore.EVENTS.SESSION_EXPIRED, callback);
1393
- }
1394
1322
  setSessionInfo(sessionInfo) {
1395
1323
  this.info.isLoggedIn = sessionInfo.isLoggedIn;
1396
1324
  this.info.webId = sessionInfo.webId;
@@ -1448,7 +1376,7 @@ function getDefaultSession() {
1448
1376
  * @since 1.3.0
1449
1377
  */
1450
1378
  /* eslint-disable-next-line no-shadow */
1451
- const fetch = (...args) => {
1379
+ const fetch$1 = (...args) => {
1452
1380
  const session = getDefaultSession();
1453
1381
  return session.fetch(...args);
1454
1382
  };
@@ -1486,43 +1414,6 @@ const handleIncomingRedirect = (...args) => {
1486
1414
  const session = getDefaultSession();
1487
1415
  return session.handleIncomingRedirect(...args);
1488
1416
  };
1489
- /**
1490
- * Register a callback function to be called when a user completes login.
1491
- *
1492
- * The callback is called when {@link handleIncomingRedirect} completes successfully.
1493
- * @since 1.3.0
1494
- *
1495
- * @param callback The function called when a user completes login.
1496
- * @deprecated Prefer events.on(EVENTS.LOGIN, callback)
1497
-
1498
- */
1499
- const onLogin = (...args) => {
1500
- const session = getDefaultSession();
1501
- return session.onLogin(...args);
1502
- };
1503
- /**
1504
- * Register a callback function to be called when a user logs out:
1505
- *
1506
- * @param callback The function called when a user completes logout.
1507
- * @since 1.3.0
1508
- * @deprecated Prefer events.on(EVENTS.LOGOUT, callback)
1509
- *
1510
- */
1511
- const onLogout = (...args) => {
1512
- const session = getDefaultSession();
1513
- return session.onLogout(...args);
1514
- };
1515
- /**
1516
- * Register a callback function to be called when a session is restored:
1517
- *
1518
- * @param callback The function called when a session is restored.
1519
- * @since 1.3.0
1520
- * @deprecated Prefer events.on(EVENTS.SESSION_RESTORED, callback)
1521
- */
1522
- const onSessionRestore = (...args) => {
1523
- const session = getDefaultSession();
1524
- return session.onSessionRestore(...args);
1525
- };
1526
1417
  /**
1527
1418
  * {@link SessionEventEmitter} instance to subscribe to events by the default session.
1528
1419
  *
@@ -1533,30 +1424,26 @@ const events = () => {
1533
1424
  };
1534
1425
 
1535
1426
  Object.defineProperty(exports, 'ConfigurationError', {
1536
- enumerable: true,
1537
- get: function () { return solidClientAuthnCore.ConfigurationError; }
1427
+ enumerable: true,
1428
+ get: function () { return solidClientAuthnCore.ConfigurationError; }
1538
1429
  });
1539
1430
  Object.defineProperty(exports, 'EVENTS', {
1540
- enumerable: true,
1541
- get: function () { return solidClientAuthnCore.EVENTS; }
1431
+ enumerable: true,
1432
+ get: function () { return solidClientAuthnCore.EVENTS; }
1542
1433
  });
1543
1434
  Object.defineProperty(exports, 'InMemoryStorage', {
1544
- enumerable: true,
1545
- get: function () { return solidClientAuthnCore.InMemoryStorage; }
1435
+ enumerable: true,
1436
+ get: function () { return solidClientAuthnCore.InMemoryStorage; }
1546
1437
  });
1547
1438
  Object.defineProperty(exports, 'NotImplementedError', {
1548
- enumerable: true,
1549
- get: function () { return solidClientAuthnCore.NotImplementedError; }
1439
+ enumerable: true,
1440
+ get: function () { return solidClientAuthnCore.NotImplementedError; }
1550
1441
  });
1551
1442
  exports.Session = Session;
1552
1443
  exports.events = events;
1553
- exports.fetch = fetch;
1554
- exports.getClientAuthenticationWithDependencies = getClientAuthenticationWithDependencies;
1444
+ exports.fetch = fetch$1;
1555
1445
  exports.getDefaultSession = getDefaultSession;
1556
1446
  exports.handleIncomingRedirect = handleIncomingRedirect;
1557
1447
  exports.login = login;
1558
1448
  exports.logout = logout;
1559
- exports.onLogin = onLogin;
1560
- exports.onLogout = onLogout;
1561
- exports.onSessionRestore = onSessionRestore;
1562
1449
  //# sourceMappingURL=index.js.map