@axa-fr/oidc-client 7.27.15 → 7.27.17

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/README.md CHANGED
@@ -315,11 +315,23 @@ export class OidcClient {
315
315
  static getOrCreate(getFetch: () => Fetch)(configuration: OidcConfiguration, name?: string): OidcClient;
316
316
 
317
317
  /**
318
- * Retrieves an existing OidcClient instance with the specified name, or creates a new instance if it does not exist.
318
+ * Retrieves an existing OidcClient instance with the specified name.
319
+ * Since issue #1679, this returns `null` when no instance has been
320
+ * initialized for the given name (instead of throwing). Use
321
+ * `OidcClient.getOrThrow` to preserve the previous fail-fast behaviour.
319
322
  * @param name The name of the OidcClient instance to retrieve.
320
- * @returns The existing OidcClient instance or a new instance with the specified name.
323
+ * @returns The existing OidcClient instance, or null if none exists.
321
324
  */
322
- static get(name?: string): OidcClient;
325
+ static get(name?: string): OidcClient | null;
326
+
327
+ /**
328
+ * Same as `OidcClient.get` but throws an explicit error when no instance
329
+ * has been initialized for the given name. Useful when you want to fail
330
+ * fast on misconfiguration.
331
+ * @param name The name of the OidcClient instance to retrieve.
332
+ * @returns The existing OidcClient instance.
333
+ */
334
+ static getOrThrow(name?: string): OidcClient;
323
335
 
324
336
  /**
325
337
  * The names of the events supported by the Oidc class.