diff --git a/frontend/src/app.css b/frontend/src/app.css index ebc48db..c1e3758 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -716,6 +716,9 @@ form input[type="file"] { outline: none; } +/* Generierte Passphrase: ein Klick markiert sie ganz, zum Kopieren. */ +#passphrase { user-select: all; } + form input[type="checkbox"] { width: auto; margin: 4px 0.3rem 4px 0; diff --git a/frontend/src/pages/KeysPage.tsx b/frontend/src/pages/KeysPage.tsx index a940938..81f7093 100644 --- a/frontend/src/pages/KeysPage.tsx +++ b/frontend/src/pages/KeysPage.tsx @@ -7,12 +7,10 @@ import { AuthBox } from "../components/AuthBox"; import { formatTime } from "../format"; import { download, - formatFingerprint, generateKey, generatePassphrase, loadLocalKey, normalizePassphrase, - passphraseWords, probeSupport, saveLocalKey, supported, @@ -138,9 +136,6 @@ function KeyDetails({ info }: { info: KeyInfo }) { }); return (
{formatFingerprint(info.fingerprint)}
- - Dein Schlüssel wird mit einer Passphrase aus {passphraseWords} zufälligen Wörtern geschützt, die du im - nächsten Schritt notierst. -
@@ -193,25 +184,16 @@ function CreateKey({ username, onCreated }: { username: string; onCreated: (c: C ); } -// twoPositions wählt zwei verschiedene Wortpositionen für die Kontrollabfrage. -function twoPositions(n: number): [number, number] { - const a = Math.floor(Math.random() * n); - const b = (a + 1 + Math.floor(Math.random() * (n - 1))) % n; - return a < b ? [a, b] : [b, a]; -} - function SaveKey({ username, created, onCancel }: { username: string; created: Created; onCancel: () => void }) { const qc = useQueryClient(); - const { key, words } = created; + const { key, passphrase } = created; const [saved, setSaved] = useState(false); - const [check] = useState(() => twoPositions(words.length)); const [msg, setMsg] = useState(""); const base = `kontrollverlust-${username}-${key.fingerprint.slice(0, 8)}`; const upload = useMutation({ - mutationFn: async (pass: string) => { + mutationFn: async () => { const fd = new FormData(); fd.set("key", toBase64(key.publicBinary)); - fd.set("pass", pass); await api.post