@assinafy/cli 2.1.1 → 2.1.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
@@ -1234,7 +1234,11 @@ var OAuthResource = class extends BaseResource {
1234
1234
  throw new ValidationError("OAuth issuer mismatch");
1235
1235
  }
1236
1236
  if (callback.searchParams.has("error")) {
1237
- throw new ValidationError("OAuth authorization was declined or failed");
1237
+ const error = callback.searchParams.get("error");
1238
+ const oauthError = error.length > 0 && error.length <= 64 && !/[^a-z_]/.test(error) ? error : "unknown_error";
1239
+ throw new ValidationError(`OAuth authorization was declined or failed: ${oauthError}`, {
1240
+ oauthError
1241
+ });
1238
1242
  }
1239
1243
  return this.token({
1240
1244
  grant_type: "authorization_code",