@protobase/ui 0.46.7 → 0.46.8

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.
@@ -26,7 +26,8 @@ const text = defineMessages({
26
26
  staffReasonRequired: "Say why you sign in as this person, in at least 10 characters.",
27
27
  staffForbidden: "Staff sign-in is turned off for this app.",
28
28
  untrustedCallback: "This page is not on an address the server trusts.",
29
- staffFailed: "The staff sign-in did not go through. Try again."
29
+ staffFailed: "The staff sign-in did not go through. Try again.",
30
+ passwordLeaked: "This password appears in a known data breach. Choose a different one."
30
31
  },
31
32
  nl: {
32
33
  tooManyRequests: "Te veel pogingen. Wacht een minuut en probeer het opnieuw.",
@@ -53,7 +54,8 @@ const text = defineMessages({
53
54
  staffReasonRequired: "Zeg in minstens 10 tekens waarom je als deze persoon inlogt.",
54
55
  staffForbidden: "Inloggen als medewerker staat uit voor deze app.",
55
56
  untrustedCallback: "Deze pagina staat niet op een adres dat de server vertrouwt.",
56
- staffFailed: "De inlog als medewerker lukte niet. Probeer het opnieuw."
57
+ staffFailed: "De inlog als medewerker lukte niet. Probeer het opnieuw.",
58
+ passwordLeaked: "Dit wachtwoord komt voor in een bekend datalek. Kies een ander wachtwoord."
57
59
  }
58
60
  });
59
61
  const providerText = defineMessages({
@@ -94,7 +96,8 @@ const messages = {
94
96
  AUTHENTICATION_FAILED: "passkeyFailed",
95
97
  PREVIOUSLY_REGISTERED: "passkeyAdded",
96
98
  ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED: "passkeyAdded",
97
- SESSION_NOT_FRESH: "notFresh"
99
+ SESSION_NOT_FRESH: "notFresh",
100
+ PASSWORD_COMPROMISED: "passwordLeaked"
98
101
  };
99
102
  const lookup = (ids, code) => {
100
103
  const id = code ? ids[code] : void 0;
@@ -1,5 +1,6 @@
1
1
  import { text } from "./messages.js";
2
2
  import { useAuth } from "./auth-provider.js";
3
+ import { authMessage } from "./auth-messages.js";
3
4
  import { ResetPasswordForm } from "./reset-password-form.js";
4
5
  import { useState } from "react";
5
6
  import { AuthError } from "@protobase/client";
@@ -10,7 +11,7 @@ const resetPasswordMessage = (error) => {
10
11
  if (error.status === 429) return text("tooManyAttempts");
11
12
  if (error.code === "PASSWORD_TOO_SHORT") return text("useAtLeast", 12);
12
13
  if (error.code === "PASSWORD_TOO_LONG") return text("passwordTooLong");
13
- return error.message;
14
+ return authMessage(error);
14
15
  };
15
16
  /** Sets a new password with the token of an emailed reset link. */
16
17
  const ResetPasswordPage = ({ token, onDone, onRequestNewLink, onBack }) => {
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.46.7";
2
+ var version = "0.46.8";
3
3
  var protobase = { "pluginApi": 1 };
4
4
  //#endregion
5
5
  export { protobase, version };