@nauth-toolkit/client 0.1.99 → 0.1.100

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/index.d.mts CHANGED
@@ -361,6 +361,26 @@ interface SocialLoginOptions {
361
361
  * Default: 'login'
362
362
  */
363
363
  action?: 'login' | 'link';
364
+ /**
365
+ * Optional OAuth parameters to pass to the provider
366
+ *
367
+ * These parameters override config defaults and allow per-request customization.
368
+ * Use cases:
369
+ * - Google: Force account chooser, restrict to domain
370
+ * - Facebook: Rerequest declined permissions
371
+ * - Apple: Add nonce for ID token validation
372
+ *
373
+ * @example Google - Force account chooser
374
+ * ```typescript
375
+ * { prompt: 'select_account' }
376
+ * ```
377
+ *
378
+ * @example Facebook - Rerequest permissions
379
+ * ```typescript
380
+ * { auth_type: 'rerequest' }
381
+ * ```
382
+ */
383
+ oauthParams?: Record<string, string>;
364
384
  }
365
385
  /**
366
386
  * Linked social accounts response.
package/dist/index.d.ts CHANGED
@@ -361,6 +361,26 @@ interface SocialLoginOptions {
361
361
  * Default: 'login'
362
362
  */
363
363
  action?: 'login' | 'link';
364
+ /**
365
+ * Optional OAuth parameters to pass to the provider
366
+ *
367
+ * These parameters override config defaults and allow per-request customization.
368
+ * Use cases:
369
+ * - Google: Force account chooser, restrict to domain
370
+ * - Facebook: Rerequest declined permissions
371
+ * - Apple: Add nonce for ID token validation
372
+ *
373
+ * @example Google - Force account chooser
374
+ * ```typescript
375
+ * { prompt: 'select_account' }
376
+ * ```
377
+ *
378
+ * @example Facebook - Rerequest permissions
379
+ * ```typescript
380
+ * { auth_type: 'rerequest' }
381
+ * ```
382
+ */
383
+ oauthParams?: Record<string, string>;
364
384
  }
365
385
  /**
366
386
  * Linked social accounts response.
package/dist/index.mjs CHANGED
@@ -2006,6 +2006,9 @@ var NAuthClient = class {
2006
2006
  if (typeof options?.appState === "string" && options.appState.trim() !== "") {
2007
2007
  startUrl.searchParams.set("appState", options.appState);
2008
2008
  }
2009
+ if (options?.oauthParams && Object.keys(options.oauthParams).length > 0) {
2010
+ startUrl.searchParams.set("oauthParams", JSON.stringify(options.oauthParams));
2011
+ }
2009
2012
  window.location.href = startUrl.toString();
2010
2013
  }
2011
2014
  }