cauthy-auth 0.37.0 → 0.38.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/index.mjs CHANGED
@@ -1687,7 +1687,8 @@ function createCauthy(given = {}) {
1687
1687
  // Whether the workspace signs people in with a password at all. A
1688
1688
  // Cauthy from before the setting says nothing of it: then it does.
1689
1689
  passwordSignIn: settings.data?.allow_password !== false,
1690
- signUp: settings.data?.allow_signup !== false,
1690
+ // The workspace's switch, and how the application's own system takes sign-ups.
1691
+ signUp: settings.data?.allow_signup !== false && settings.data?.signup?.mode !== "invite_only",
1691
1692
  // The application's system makes an organization per sign-up: the form asks the company's name.
1692
1693
  ...settings.data?.signup?.organization?.ask === true ? { organization: { ask: true, required: settings.data.signup.organization.required === true } } : {},
1693
1694
  // A sign-in link needs a page of the application to open.
@@ -2050,7 +2051,8 @@ function createCauthy(given = {}) {
2050
2051
  if (route === "/me/mfa/setup") {
2051
2052
  const res = await as("/v1/auth/mfa/setup", { password });
2052
2053
  if (res.error) return refused(res, res.error.code === "step_up_required" ? "password" : void 0);
2053
- return json({ status: "started", secret: String(res.data?.secret ?? ""), otpauthUri: String(res.data?.otpauth_uri ?? "") }, 200, mine.headers);
2054
+ const qr = String(res.data?.qr ?? "");
2055
+ return json({ status: "started", secret: String(res.data?.secret ?? ""), otpauthUri: String(res.data?.otpauth_uri ?? ""), qr: qr.startsWith("data:image/png;base64,") ? qr : "" }, 200, mine.headers);
2054
2056
  }
2055
2057
  if (route === "/me/mfa/verify") {
2056
2058
  const bad = checkCode(b.code);