@assinafy/cli 2.4.1 → 2.4.2

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/api.js CHANGED
@@ -1145,7 +1145,11 @@ var FieldsResource = class extends BaseResource {
1145
1145
  }
1146
1146
  };
1147
1147
  function validationConfig(signerAccessCode) {
1148
- return signerAccessCode ? signerAccessConfig(signerAccessCode) : void 0;
1148
+ if (signerAccessCode === void 0) return void 0;
1149
+ if (typeof signerAccessCode !== "string" || !signerAccessCode.trim()) {
1150
+ throw new ValidationError("signerAccessCode is required when supplied");
1151
+ }
1152
+ return signerAccessConfig(signerAccessCode);
1149
1153
  }
1150
1154
 
1151
1155
  // src/api/resources/oauth.ts
@@ -1253,6 +1257,9 @@ var OAuthResource = class extends BaseResource {
1253
1257
  if (callback.searchParams.get("iss") !== request.issuer) {
1254
1258
  throw new ValidationError("OAuth issuer mismatch");
1255
1259
  }
1260
+ if (callback.searchParams.has("code") === callback.searchParams.has("error")) {
1261
+ throw new ValidationError("OAuth callback must contain exactly one of code or error");
1262
+ }
1256
1263
  if (callback.searchParams.has("error")) {
1257
1264
  const error = callback.searchParams.get("error");
1258
1265
  const oauthError = error.length > 0 && error.length <= 64 && !/[^a-z_]/.test(error) ? error : "unknown_error";