cauthy-auth 0.27.0 → 0.27.1

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/cli.js CHANGED
@@ -928,7 +928,9 @@ function createSystem(given = {}) {
928
928
  async function fail2(res, what) {
929
929
  const body = await res.json().catch(() => null);
930
930
  const first = body?.errors?.[0];
931
- throw new CauthyApiError(res.status, first?.code ?? "error", `Cauthy refused ${what} (${res.status}): ${first?.message ?? res.statusText}`);
931
+ const code = typeof body?.error === "string" ? body.error : first?.code;
932
+ const message = typeof body?.error === "string" ? body.error_description : first?.message;
933
+ throw new CauthyApiError(res.status, code ?? "error", `Cauthy refused ${what} (${res.status}): ${message ?? res.statusText}`);
932
934
  }
933
935
  let held;
934
936
  let asking;
package/dist/client.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { CauthyTheme } from './theme.mjs';
2
2
  import { i as PublicSession } from './system-BxMsSIu1.mjs';
3
- import { A as AuthField } from './validate-BTRit1O1.mjs';
4
- export { F as FieldProblem, M as MIN_PASSWORD, c as checkCode, a as checkEmail, b as checkName, d as checkNewPassword, e as checkPassword } from './validate-BTRit1O1.mjs';
3
+ import { A as AuthField } from './validate-YbEfIzfl.mjs';
4
+ export { F as FieldProblem, M as MIN_PASSWORD, c as checkCode, a as checkEmail, b as checkName, d as checkNewPassword, e as checkPassword } from './validate-YbEfIzfl.mjs';
5
5
  import 'jose';
6
6
 
7
7
  /** Whether this browser can use a passkey at all. */
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { CauthyTheme } from './theme.js';
2
2
  import { i as PublicSession } from './system-DTIeDXDP.js';
3
- import { A as AuthField } from './validate-BTRit1O1.js';
4
- export { F as FieldProblem, M as MIN_PASSWORD, c as checkCode, a as checkEmail, b as checkName, d as checkNewPassword, e as checkPassword } from './validate-BTRit1O1.js';
3
+ import { A as AuthField } from './validate-YbEfIzfl.js';
4
+ export { F as FieldProblem, M as MIN_PASSWORD, c as checkCode, a as checkEmail, b as checkName, d as checkNewPassword, e as checkPassword } from './validate-YbEfIzfl.js';
5
5
  import 'jose';
6
6
 
7
7
  /** Whether this browser can use a passkey at all. */
package/dist/client.js CHANGED
@@ -151,8 +151,8 @@ function fromWire(wire) {
151
151
  }
152
152
 
153
153
  // src/validate.ts
154
- var MIN_PASSWORD = 8;
155
- var MAX_PASSWORD = 256;
154
+ var MIN_PASSWORD = 12;
155
+ var MAX_PASSWORD = 128;
156
156
  var MAX_NAME = 120;
157
157
  var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
158
158
  function checkEmail(value) {