@openg2p/registry-widgets 1.1.0-dev.5 → 1.1.0-dev.7

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.esm.js CHANGED
@@ -10618,7 +10618,7 @@ const IdAuthenticationWidget = ({ config, schemaData: propSchemaData }) => {
10618
10618
  return dataPath;
10619
10619
  }, [dataPath]);
10620
10620
  const authConfig = config['widget-auth-config'];
10621
- const registerId = resolveValueFromSources(paths.registerId, values, schemaData);
10621
+ const registerId = authConfig?.registerId ?? undefined;
10622
10622
  const internalRecordId = resolveValueFromSources(paths.internalRecordId, values, schemaData);
10623
10623
  const initiatedByStaffId = resolveValueFromSources(paths.initiatedByStaffId, values, schemaData);
10624
10624
  const providerId = authConfig?.providerId;
@@ -10714,12 +10714,16 @@ const IdAuthenticationWidget = ({ config, schemaData: propSchemaData }) => {
10714
10714
  if (!url && canCallAuthApi) {
10715
10715
  setAuthActionLoading(true);
10716
10716
  try {
10717
- const resp = await dataSourceRequestHandler(authConfig.service, authConfig.authenticateEndpoint, authConfig.authenticateMethod || 'POST', {
10717
+ const basePayload = {
10718
10718
  register_id: registerId,
10719
10719
  internal_record_id: internalRecordId,
10720
- provider_id: authConfig.providerId,
10720
+ provider_id: providerId,
10721
10721
  initiated_by_staff_id: initiatedByStaffId,
10722
- });
10722
+ };
10723
+ const requestParams = basePayload;
10724
+ // eslint-disable-next-line no-console
10725
+ console.log('[IdAuthenticationWidget] authenticate_registrant params', requestParams);
10726
+ const resp = await dataSourceRequestHandler(authConfig.service, authConfig.authenticateEndpoint, authConfig.authenticateMethod || 'POST', requestParams);
10723
10727
  const payload = unwrapPayload(resp);
10724
10728
  const authUrl = pickAuthorizationUrl(payload, authConfig.authorizationUrlKey);
10725
10729
  url = authUrl || null;