+
+ }
+ title="Account information"
+ >
+ Set up your account.... OR ELSE!
+
+
+
+
+
+
);
}
diff --git a/src/pages/parts/auth/LoginFormPart.tsx b/src/pages/parts/auth/LoginFormPart.tsx
index 72aabeb0..f5082826 100644
--- a/src/pages/parts/auth/LoginFormPart.tsx
+++ b/src/pages/parts/auth/LoginFormPart.tsx
@@ -3,7 +3,13 @@ import { useAsyncFn } from "react-use";
import { verifyValidMnemonic } from "@/backend/accounts/crypto";
import { Button } from "@/components/Button";
-import { Input } from "@/components/player/internals/ContextMenu/Input";
+import { BrandPill } from "@/components/layout/BrandPill";
+import {
+ LargeCard,
+ LargeCardButtons,
+ LargeCardText,
+} from "@/components/layout/LargeCard";
+import { AuthInputBox } from "@/components/text-inputs/AuthInputBox";
import { useAuth } from "@/hooks/auth/useAuth";
interface LoginFormPartProps {
@@ -39,14 +45,38 @@ export function LoginFormPart(props: LoginFormPartProps) {
);
return (
-
-
passphrase
-
-
Device name
-
- {result.loading ?
Loading...
: null}
- {result.error ?
error: {result.error.toString()}
: null}
-
-
+ }>
+
+ Oh, you're asking for the key to my top-secret lair, also known as
+ The Fortress of Wordsmithery, accessed only by reciting the sacred
+ incantation of the 12-word passphrase!
+
+
+
+
+ {result.loading ?
Loading...
: null}
+ {result.error && !result.loading ? (
+
+ {result.error.message}
+
+ ) : null}
+
+
+
+
+
+
);
}
diff --git a/src/pages/parts/auth/VerifyPassphrasePart.tsx b/src/pages/parts/auth/VerifyPassphrasePart.tsx
index 3bd58d55..270be190 100644
--- a/src/pages/parts/auth/VerifyPassphrasePart.tsx
+++ b/src/pages/parts/auth/VerifyPassphrasePart.tsx
@@ -1,8 +1,15 @@
-import { useState } from "react";
+import { useCallback, useEffect, useState } from "react";
+import { GoogleReCaptcha, useGoogleReCaptcha } from "react-google-recaptcha-v3";
import { useAsyncFn } from "react-use";
import { Button } from "@/components/Button";
-import { Input } from "@/components/player/internals/ContextMenu/Input";
+import { Icon, Icons } from "@/components/Icon";
+import {
+ LargeCard,
+ LargeCardButtons,
+ LargeCardText,
+} from "@/components/layout/LargeCard";
+import { AuthInputBox } from "@/components/text-inputs/AuthInputBox";
import { useAuth } from "@/hooks/auth/useAuth";
import { AccountProfile } from "@/pages/parts/auth/AccountCreatePart";
@@ -16,10 +23,17 @@ export function VerifyPassphrase(props: VerifyPassphraseProps) {
const [mnemonic, setMnemonic] = useState("");
const { register, restore } = useAuth();
+ const { executeRecaptcha } = useGoogleReCaptcha();
+
const [result, execute] = useAsyncFn(
async (inputMnemonic: string) => {
+ const recaptchaToken = executeRecaptcha
+ ? await executeRecaptcha()
+ : undefined;
+
if (!props.mnemonic || !props.userData)
- throw new Error("invalid input data");
+ throw new Error("Data is not valid");
+ if (!recaptchaToken) throw new Error("ReCaptcha validation failed");
if (inputMnemonic !== props.mnemonic)
throw new Error("Passphrase doesn't match");
@@ -28,6 +42,7 @@ export function VerifyPassphrase(props: VerifyPassphraseProps) {
await register({
mnemonic: inputMnemonic,
userData: props.userData,
+ recaptchaToken,
});
// TODO import (and sort out conflicts)
@@ -40,12 +55,29 @@ export function VerifyPassphrase(props: VerifyPassphraseProps) {
);
return (
-
-
verify passphrase
-
- {result.loading ?
Loading...
: null}
- {result.error ?
error: {result.error.toString()}
: null}
-
-
+
+ }
+ title="Enter your passphrase"
+ >
+ If you've already lost it, how will you ever be able to take care
+ of a child?
+
+
+ {result.error ? (
+