Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Settings lists a profile's passkeys and adds, renames or removes one, and another device joins the profile with a one-time code or its QR code (#95)
Duarte Santos62a7cf3e4d7e
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsxindex eae9ba68a..2dc1362dd 100644--- a/frontend/src/App.jsx+++ b/frontend/src/App.jsx@@ -22,6 +22,7 @@ import Toast from './components/Toast.jsx'import SyncBanner from './components/SyncBanner.jsx'import RestTimer from './components/RestTimer.jsx'import TimerFlash from './components/TimerFlash.jsx'+import { openDeviceLinkRedeem } from './components/Passkeys.jsx'import Login from './views/Login.jsx'import MobileOnboarding from './views/MobileOnboarding.jsx'import Home from './views/Home.jsx'@@ -114,6 +115,16 @@ function Shell() {if (MOBILE || !user || !ready) returnsyncPushSubscription().catch(() => {})}, [user?.id, ready])+ // Opened from a device-link QR code (#95): once boot knows who is here, the sheet that redeems+ // it opens by itself — over the sign-in screen, or over the app for a guest or a signed-in+ // browser. Once per visit; closed, the code stays for the sign-in screen's own button.+ const linkCode = useStore(s => s.linkCode)+ const linkOffered = useRef(false)+ useEffect(() => {+ if (!ready || !linkCode || linkOffered.current) return+ linkOffered.current = true+ openDeviceLinkRedeem()+ }, [ready, linkCode])useEffect(() => {const onScroll = () => {// Modals pins the body while a sheet is open; scrollY is 0 then, not a position.diff --git a/frontend/src/components/Passkeys.jsx b/frontend/src/components/Passkeys.jsxnew file mode 100644index 000000000..3b6f3130c--- /dev/null+++ b/frontend/src/components/Passkeys.jsx@@ -0,0 +1,343 @@+// More than one passkey on a profile, and the one-time code that adds one on another device+// (#95). Settings → Account lists the passkeys and offers both ways to add one; the sign-in screen+// — or the link in the code's QR, opened on the other device — redeems a code. The rules are the+// server's (api/passkeys-store.js, api/device-link.js and the passkeys block in api/server.js):+// what needs proof, the last way in, how long a code lives. This only words them.+import { useEffect, useRef, useState } from 'react'+import { useStore } from '../store/useStore.js'+import { useUI } from '../store/useUI.js'+import { t } from '../lib/i18n.js'+import { dateLocale } from '../lib/i18n-core.js'+import { api, webauthnOK, passkeyAssertion, createPasskey } from '../lib/api.js'+import { copyText } from '../lib/clipboard.js'+import { deviceLinkUrl, deviceLabel } from '../lib/device-link.js'+import { askAddDeviceData, confirmSheet } from '../sheets.jsx'+import { passwordError } from './PasswordAuth.jsx'+import QrCanvas from './QrCanvas.jsx'+import { Row, Button } from './ui.jsx'++const ui = () => useUI.getState()+const toast = m => ui().toast(m)+const post = (path, body) => api(path, { method: 'POST', body: JSON.stringify(body) })+const errStyle = { color: 'var(--red)', marginTop: 10 }+// A passkey prompt the person closed is their answer, not an error worth a line in red.+const dismissed = e => e?.name === 'NotAllowedError' || e?.name === 'AbortError'+// How long a code lives (api/device-link.js DEVICE_LINK_TTL_MS), for the sentence that says so.+const LINK_MINUTES = 10+// The server keeps a creation challenge five minutes; one older than four is asked for again+// rather than risked on a prompt that then fails.+const CHALLENGE_FRESH_MS = 4 * 60000++// The year only when it is not this one, so "Added … · Last used …" fits on one line.+const when = iso => {+ const d = new Date(iso)+ const year = d.getFullYear() !== new Date().getFullYear() ? { year: 'numeric' } : {}+ try { return d.toLocaleDateString(dateLocale(), { day: 'numeric', month: 'short', ...year }) }+ catch { return '' }+}+const label = (p, i) => p.name || t('Passkey {0}', i + 1)+// "Added 3 Sep 2026 · Last used 22 Sep 2026" — a passkey from before either was recorded has none.+const meta = p => [p.created && t('Added {0}', when(p.created)), p.lastUsed && t('Last used {0}', when(p.lastUsed))].filter(Boolean).join(' · ')++// The server's refusal in the UI language. The proof codes are the password sheet's; the rest+// are this feature's own (api/openapi.yaml, tag passkeys).+export function passkeyError(e) {+ // The authenticator already holds one of this profile's passkeys (excludeCredentials).+ if (e?.name === 'InvalidStateError') return t('This device already has a passkey for this profile.')+ switch (e?.data?.code) {+ case 'last-way-in': return t('It is your only way in, so it cannot be removed until there is another.')+ case 'passkey-limit': return t('This profile already has as many passkeys as it can hold.')+ case 'credential-exists': return t('This passkey already belongs to a profile.')+ case 'link-invalid': return t('That code is wrong, used or expired — make a new one on your other device.')+ }+ return passwordError(e)+}++// GET /api/account/passkeys: { passkeys, password, lastWayIn }, or null until it answers — and+// for as long as the answer is not a list, which is what a server from before #95 gives, so+// Settings on such a server simply has no passkey rows.+const listOf = r => (Array.isArray(r?.passkeys) ? r : null)+export function usePasskeys(on) {+ const [st, setSt] = useState(null)+ const load = () => api('/api/account/passkeys').then(r => setSt(listOf(r))).catch(() => {})+ useEffect(() => { if (on) load() }, [on])+ return { st, load, set: setSt }+}++/* "Confirm it is you" — what the server asks before anything that adds a way in (proveOwner in+ api/server.js): a passkey this profile already has, or its current password. Hands the body+ the server takes to `onProof`, and shows the refusal when that throws. */+function ProveOwner({ state, onProof }) {+ const name = useStore(s => s.user?.name) || ''+ const [pw, setPw] = useState('')+ const [busy, setBusy] = useState(false)+ const [err, setErr] = useState(null)+ const run = async proof => {+ if (busy) return+ setBusy(true); setErr(null)+ try { await onProof(await proof()) }+ catch (e) { if (!dismissed(e)) setErr(passkeyError(e)) }+ finally { setBusy(false) }+ }+ const withPasskey = state.passkeys.length > 0 && webauthnOK()+ const withPassword = ev => {+ ev.preventDefault()+ if (!pw) { setErr(t('Enter your password.')); return }+ run(async () => ({ current: pw }))+ }+ return <>+ {withPasskey && <Button variant="primary" icon="lock" disabled={busy} onClick={() => run(passkeyAssertion)}>{t('Confirm with a passkey')}</Button>}+ {state.password && <form onSubmit={withPassword} noValidate>+ {withPasskey && <div className="dim small" style={{ margin: '14px 0 8px', textAlign: 'center' }}>{t('or with your password')}</div>}+ {/* Tells a password manager which account the password belongs to. */}+ <input type="text" name="username" autoComplete="username" value={name} readOnly hidden />+ <input className="input" type="password" name="current-password" autoComplete="current-password" placeholder={t('Current password')}+ value={pw} onChange={e => setPw(e.target.value)} />+ <div style={{ height: 10 }} />+ <Button type="submit" variant={withPasskey ? 'plain' : 'primary'} disabled={busy}>{t('Continue')}</Button>+ </form>}+ {!withPasskey && !state.password && <div className="dim small">{t('This browser cannot confirm with your passkey. Do this on a device that holds one.')}</div>}+ {err && <div className="small" role="alert" style={errStyle}>{err}</div>}+ </>+}++/* ------------------------------------------------------------------- Settings -------------+ Settings → Account: the passkeys, and a code for another device. `changed` tells Settings to+ read the list again, and the password row with it — whether a password may be removed depends+ on how many passkeys there are. */+export function PasskeysRow({ state, changed }) {+ if (!state) return null+ const n = state.passkeys.length+ return <Row icon="lock" iconTint="var(--acc)" title={t('Passkeys')} accessory="chevron"+ subtitle={n === 0 ? t('None yet — add one to sign in without your password.') : n === 1 ? t('1 passkey') : t('{0} passkeys', n)}+ onClick={() => ui().openSheet(close => <PasskeysSheet close={close} changed={changed} />)} />+}++export function DeviceLinkRow({ state }) {+ if (!state) return null+ return <Row icon="qr" iconTint="var(--blue)" title={t('Add another device')} accessory="chevron"+ subtitle={t('A one-time code lets your phone or another computer sign in with a passkey of its own.')}+ onClick={() => ui().openSheet(close => <DeviceLinkSheet close={close} />)} />+}++export function PasskeysSheet({ close, changed }) {+ const { st, set } = usePasskeys(true)+ const done = r => { set(listOf(r) || st); changed?.() }+ if (!st) return <><h3>{t('Passkeys')}</h3><div className="muted small">…</div></>+ const edit = (p, i) => ui().openSheet(c => <PasskeySheet passkey={p} title={label(p, i)} lastWayIn={st.lastWayIn} close={c} done={done} />)+ const add = () => ui().openSheet(c => <AddPasskeySheet state={st} close={c} done={done} />)+ return <>+ <h3>{t('Passkeys')}</h3>+ <div className="muted small" style={{ marginBottom: 14 }}>+ {t('Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.')}+ </div>+ {st.passkeys.length > 0 && <div className="sect-b">+ {st.passkeys.map((p, i) => <Row key={p.id} icon="lock" iconTint="var(--grey)" title={label(p, i)} subtitle={meta(p) || null}+ accessory="chevron" onClick={() => edit(p, i)} />)}+ </div>}+ {st.passkeys.length === 1 && st.lastWayIn && <div className="dim small" style={{ marginTop: 8 }}>+ {t('It is your only way in, so it cannot be removed until there is another.')}</div>}+ <div style={{ height: 14 }} />+ {webauthnOK() && <><Button variant="primary" icon="plus" onClick={add}>{t('Add a passkey')}</Button><div style={{ height: 8 }} /></>}+ <Button onClick={close}>{t('Done')}</Button>+ </>+}++// One passkey: its name, and removing it. Removing does not end a session the passkey opened —+// sessions are not tied to one (api/server.js) — which the confirm says, with the way to do that.+function PasskeySheet({ passkey, title, lastWayIn, close, done }) {+ const [name, setName] = useState(passkey.name || '')+ const [busy, setBusy] = useState(false)+ const [err, setErr] = useState(null)+ const save = async ev => {+ ev.preventDefault()+ if (busy) return+ setBusy(true); setErr(null)+ try { done(await post('/api/account/passkeys/rename', { id: passkey.id, name })); close() }+ catch (e) { setErr(passkeyError(e)) }+ finally { setBusy(false) }+ }+ const remove = () => confirmSheet({+ title: t('Remove this passkey?'),+ message: t('It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.'),+ confirmText: t('Remove'), danger: true,+ onConfirm: () => api('/api/account/passkeys?id=' + encodeURIComponent(passkey.id), { method: 'DELETE' })+ .then(r => { done(r); close(); toast(t('Passkey removed')) })+ .catch(e => toast(passkeyError(e))),+ })+ const info = meta(passkey)+ return <>+ <h3>{title}</h3>+ {info && <div className="muted small" style={{ marginBottom: 14 }}>{info}</div>}+ <form onSubmit={save} noValidate>+ <input className="input" placeholder={t('Name, e.g. Work laptop')} maxLength={40} value={name} onChange={e => setName(e.target.value)} />+ {err && <div className="small" role="alert" style={errStyle}>{err}</div>}+ <div style={{ height: 12 }} />+ <Button type="submit" variant="primary" disabled={busy}>{t('Save')}</Button>+ </form>+ <div style={{ height: 8 }} />+ {lastWayIn+ ? <div className="dim small">{t('It is your only way in, so it cannot be removed until there is another.')}</div>+ : <button type="button" className="btn danger" disabled={busy} onClick={remove}>{t('Remove passkey')}</button>}+ </>+}++/* Adding one from Settings: the proof first, then the passkey prompt — two taps rather than one,+ because each prompt wants a tap of its own (Safari refuses a second prompt opened from the same+ one), and a password, where that is the proof, is typed before either. What it is for: a+ security key, a password manager, a phone through the browser's own QR prompt. Another device+ that can open openGym itself is easier with a code (DeviceLinkSheet). */+function AddPasskeySheet({ state, close, done }) {+ // Blank to start with: what gets added here is rarely this browser (a key, a phone, a manager).+ const [name, setName] = useState('')+ const [ready, setReady] = useState(null) // { cid, options } once the proof went through+ const [busy, setBusy] = useState(false)+ const [err, setErr] = useState(null)+ const create = async () => {+ if (busy) return+ setBusy(true); setErr(null)+ try {+ const credential = await createPasskey(ready.options)+ done(await post('/api/account/passkeys/verify', { cid: ready.cid, credential, name }))+ close()+ toast(t('Passkey added'))+ } catch (e) {+ if (dismissed(e)) return+ setErr(passkeyError(e))+ // The server spent the challenge on that answer: a retry starts from the proof again.+ if (e?.status) setReady(null)+ } finally { setBusy(false) }+ }+ return <>+ <h3>{t('Add a passkey')}</h3>+ <div className="muted small" style={{ marginBottom: 14 }}>{ready+ ? t('Confirmed. Now create the new passkey — your browser asks where to keep it.')+ : t('For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.')}</div>+ <input className="input" placeholder={t('Name, e.g. Work laptop')} maxLength={40} value={name} onChange={e => setName(e.target.value)} />+ <div style={{ height: 12 }} />+ {ready ? <Button variant="primary" icon="plus" disabled={busy} onClick={create}>{t('Create passkey')}</Button>+ : <ProveOwner state={state} onProof={async proof => setReady(await post('/api/account/passkeys/options', proof))} />}+ {err && <div className="small" role="alert" style={errStyle}>{err}</div>}+ </>+}++/* A code for another device: after the same proof, the code itself, a QR code of the link that+ carries it, and a way to copy that link. The other device either scans it or types the code on+ its sign-in screen. When it expires the sheet says so and offers a new one. */+export function DeviceLinkSheet({ close }) {+ const { st } = usePasskeys(true)+ const [link, setLink] = useState(null) // { code, expires }+ const [expired, setExpired] = useState(false)+ useEffect(() => {+ if (!link) return+ setExpired(false)+ const timer = setTimeout(() => setExpired(true), Math.max(0, link.expires - Date.now()))+ return () => clearTimeout(timer)+ }, [link])+ const url = link ? deviceLinkUrl(link.code) : ''+ const copy = async () => { if (await copyText(url)) toast(t('Copied')) }+ return <>+ <h3>{t('Add another device')}</h3>+ {!st ? <div className="muted small">…</div> : !link ? <>+ <div className="muted small" style={{ marginBottom: 14 }}>+ {t('You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.')}+ </div>+ <ProveOwner state={st} onProof={async proof => setLink(await post('/api/account/device-link', proof))} />+ </> : expired ? <>+ <div className="muted small" style={{ marginBottom: 14 }}>{t('This code has expired.')}</div>+ <Button variant="primary" onClick={() => setLink(null)}>{t('Make a new code')}</Button>+ </> : <>+ <div className="muted small" style={{ marginBottom: 14 }}>+ {t('Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.', LINK_MINUTES)}+ </div>+ <div className="ci-qr-plate" style={{ width: 'fit-content', margin: '0 auto 14px' }}><QrCanvas value={url} size={200} /></div>+ {/* Read out or typed character by character: left to right in every language. */}+ <div className="card" dir="ltr" style={{ textAlign: 'center', fontSize: 24, fontWeight: 700, letterSpacing: '.12em', padding: '14px 0' }}>{link.code}</div>+ <div style={{ height: 12 }} />+ <Button icon="link" onClick={copy}>{t('Copy link')}</Button>+ </>}+ <div style={{ height: 8 }} />+ <Button variant="ghost" onClick={close}>{t('Done')}</Button>+ </>+}++/* ------------------------------------------------------------------ the other device -------+ Redeeming a code: the device being added creates a passkey of its own, and that passkey signs it+ in. The code comes from the link's ?link= (the store holds it, see boot()) or is typed. A code+ from a link is checked as the sheet opens, so it can say whose profile this device is joining+ and the passkey prompt then opens straight from the tap. The passkey is named after this+ browser (deviceLabel), which the list in Settings can change. Signed in afterwards exactly as a+ passkey sign-in on the sign-in screen is: the same account coming back merges what this device+ kept for it (adoptProfile), and another account's copy is kept aside for that one (setUser). */+export function DeviceLinkRedeemSheet({ close }) {+ const user = useStore(s => s.user)+ const pending = useStore(s => s.linkCode)+ const [code, setCode] = useState(pending || '')+ const [info, setInfo] = useState(null) // { code, cid, options, name, at } from checking the code+ const [busy, setBusy] = useState(false)+ const [err, setErr] = useState(null)+ const ref = useRef(null)+ const check = async c => {+ const r = await post('/api/device-link/options', { code: c })+ const i = { ...r, code: c, at: Date.now() }+ setInfo(i)+ return i+ }+ useEffect(() => {+ if (!webauthnOK()) return+ if (pending) check(pending).catch(e => setErr(passkeyError(e)))+ else setTimeout(() => ref.current?.focus(), 250)+ }, [])+ const submit = async ev => {+ ev.preventDefault()+ if (busy) return+ const c = code.trim()+ if (!c) { setErr(t('Enter the code from your other device.')); return }+ setBusy(true); setErr(null)+ let spent = false+ try {+ const i = info && info.code === c && Date.now() - info.at < CHALLENGE_FRESH_MS ? info : await check(c)+ const credential = await createPasskey(i.options)+ spent = true+ const r = await post('/api/device-link/verify', { code: c, cid: i.cid, credential, name: deviceLabel() })+ const st = useStore.getState()+ useStore.setState({ linkCode: null })+ const same = st.user?.id === r.user.id+ st.setUser(r.user)+ close()+ if (same) { toast(t('Passkey added')); return }+ // Signed in by now whatever happens next: a pull that fails is the sync banner's to say+ // (adoptProfile records it), not a reason to hide that this device got in.+ await st.adoptProfile(askAddDeviceData).catch(() => {})+ toast(t('Welcome back, {0}', r.user.name))+ } catch (e) {+ if (!dismissed(e)) setErr(passkeyError(e))+ // Answered by the server, the challenge is gone; the next try asks for a new one.+ if (spent || e?.status) setInfo(null)+ } finally { setBusy(false) }+ }+ if (!webauthnOK()) return <>+ <h3>{t('Add this device')}</h3>+ <div className="muted small">{t('This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.')}</div>+ <div style={{ height: 12 }} />+ <Button onClick={close}>{t('Done')}</Button>+ </>+ const joining = info && info.code === code.trim() ? info.name : null+ return <>+ <h3>{t('Add this device')}</h3>+ <div className="muted small" style={{ marginBottom: 14 }}>{joining+ ? t('Create a passkey on this device for the profile “{0}”. It signs you in here from now on.', joining)+ : t('Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.')}</div>+ {user && joining && user.name !== joining && <div className="card small muted" style={{ textAlign: 'start', marginBottom: 14 }}>+ {t('This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.', user.name, joining)}</div>}+ <form onSubmit={submit} noValidate>+ <input ref={ref} className="input" name="device-code" autoComplete="one-time-code" placeholder={t('Code from your other device')} maxLength={20}+ value={code} onChange={e => setCode(e.target.value.toUpperCase())} autoCapitalize="characters" autoCorrect="off" spellCheck={false}+ dir="ltr" style={{ letterSpacing: '.14em', fontWeight: 600, textAlign: 'center' }} />+ {err && <div className="small" role="alert" style={errStyle}>{err}</div>}+ <div style={{ height: 12 }} />+ <Button type="submit" variant="primary" disabled={busy}>{t('Create passkey')}</Button>+ </form>+ </>+}+export const openDeviceLinkRedeem = () => ui().openSheet(close => <DeviceLinkRedeemSheet close={close} />)diff --git a/frontend/src/components/Passkeys.test.jsx b/frontend/src/components/Passkeys.test.jsxnew file mode 100644index 000000000..cc8859799--- /dev/null+++ b/frontend/src/components/Passkeys.test.jsx@@ -0,0 +1,350 @@+// @vitest-environment happy-dom+import React, { act } from 'react'+import { createRoot } from 'react-dom/client'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import { passkeyError, PasskeysRow, PasskeysSheet, DeviceLinkSheet, DeviceLinkRedeemSheet } from './Passkeys.jsx'++globalThis.IS_REACT_ACT_ENVIRONMENT = true++/* More passkeys and one-time codes for another device, on screen (#95): the Settings list and+ what editing, removing and adding send; the code sheet with its proof, QR and expiry; and the+ other device's redeem sheet. The API and the passkey prompts are stand-ins; what each step+ sends, and what it says back in the UI language, is the point. */+const mocks = vi.hoisted(() => {+ const state = { webauthn: true, sheets: [], answers: {}, calls: [], store: {} }+ state.toast = vi.fn()+ state.setUser = vi.fn()+ state.adoptProfile = vi.fn(async () => ({}))+ state.passkeyAssertion = vi.fn(async () => ({ cid: 'login-cid', credential: { id: 'k1' } }))+ state.createPasskey = vi.fn(async () => ({ id: 'new-key', response: {} }))+ state.copyText = vi.fn(async () => true)+ state.confirmSheet = vi.fn()+ state.api = vi.fn(async (path, init) => {+ const method = init?.method || 'GET'+ state.calls.push({ path, method, body: init?.body ? JSON.parse(init.body) : null })+ const a = state.answers[method + ' ' + path.split('?')[0]]+ if (a instanceof Error) throw a+ return typeof a === 'function' ? a() : a ?? {}+ })+ state.snapshot = () => ({ ...state.store, setUser: state.setUser, adoptProfile: state.adoptProfile })+ return state+})+vi.mock('../store/useStore.js', () => {+ const useStore = selector => selector ? selector(mocks.snapshot()) : mocks.snapshot()+ useStore.getState = mocks.snapshot+ useStore.setState = patch => Object.assign(mocks.store, patch)+ return { useStore }+})+vi.mock('../store/useUI.js', () => {+ const snap = () => ({ toast: (...a) => mocks.toast(...a), openSheet: (render, opts) => { mocks.sheets.push({ render, opts }); return {} } })+ const useUI = selector => selector ? selector(snap()) : snap()+ useUI.getState = snap+ return { useUI }+})+vi.mock('../lib/api.js', () => ({+ api: (...a) => mocks.api(...a),+ webauthnOK: () => mocks.webauthn,+ passkeyAssertion: (...a) => mocks.passkeyAssertion(...a),+ createPasskey: (...a) => mocks.createPasskey(...a),+ // PasswordAuth.jsx, for passwordError, imports these too.+ passwordLogin: vi.fn(), passwordRegister: vi.fn(), passwordResetRedeem: vi.fn(),+}))+vi.mock('../lib/clipboard.js', () => ({ copyText: (...a) => mocks.copyText(...a) }))+vi.mock('../sheets.jsx', () => ({ askAddDeviceData: vi.fn(), confirmSheet: (...a) => mocks.confirmSheet(...a) }))+// lean-qr loads on demand; what matters here is what the QR code carries.+vi.mock('./QrCanvas.jsx', () => ({ default: ({ value }) => <canvas data-qr={value} /> }))++const fail = (status, data) => Object.assign(new Error(data?.error || 'HTTP ' + status), { status, data })+const named = (name, e = new Error(name)) => Object.assign(e, { name })++const mounted = []+function mount(el) {+ const host = document.createElement('div')+ document.body.appendChild(host)+ const root = createRoot(host)+ mounted.push({ root, host })+ act(() => root.render(el))+ return host+}+const settle = () => act(() => new Promise(r => setTimeout(r, 0)))+function type(el, value) {+ act(() => {+ Object.getOwnPropertyDescriptor(el.constructor.prototype, 'value').set.call(el, value)+ el.dispatchEvent(new Event('input', { bubbles: true }))+ })+}+const byPlaceholder = (host, p) => host.querySelector(`input[placeholder="${p}"]`)+const button = (host, text) => [...host.querySelectorAll('button')].find(b => b.textContent === text)+const click = async (host, text) => { act(() => button(host, text).click()); await settle() }+const submit = async host => { act(() => { host.querySelector('form').dispatchEvent(new Event('submit', { bubbles: true, cancelable: true })) }); await settle() }+const alertText = host => host.querySelector('[role="alert"]')?.textContent || null+// The sheet a tap opened, mounted on its own.+const openedSheet = (i = mocks.sheets.length - 1) => { const close = vi.fn(); return { host: mount(mocks.sheets[i].render(close)), close } }++const LIST = {+ passkeys: [+ { id: 'k/1+', name: 'Laptop', created: '2025-09-01T10:00:00.000Z', lastUsed: new Date().toISOString(), transports: ['internal'] },+ { id: 'k2', name: null, created: null, lastUsed: null, transports: [] }+ ],+ password: false, lastWayIn: false+}++beforeEach(() => {+ mocks.webauthn = true+ mocks.sheets.length = 0+ mocks.answers = {}+ mocks.calls.length = 0+ mocks.store = { user: { id: 'u1', name: 'Ana' }, linkCode: null }+ for (const f of [mocks.toast, mocks.setUser, mocks.adoptProfile, mocks.passkeyAssertion, mocks.createPasskey, mocks.copyText, mocks.confirmSheet]) f.mockClear()+})+afterEach(() => { vi.useRealTimers(); act(() => { mounted.splice(0).forEach(({ root, host }) => { root.unmount(); host.remove() }) }) })++describe('passkeyError', () => {+ it('words this feature’s refusals, and hands the proof refusals to the password sheet’s wording', () => {+ expect(passkeyError(named('InvalidStateError'))).toBe('This device already has a passkey for this profile.')+ expect(passkeyError(fail(400, { code: 'link-invalid' }))).toMatch(/wrong, used or expired/)+ expect(passkeyError(fail(409, { code: 'last-way-in' }))).toMatch(/only way in/)+ expect(passkeyError(fail(409, { code: 'passkey-limit' }))).toMatch(/as many passkeys/)+ expect(passkeyError(fail(403, { code: 'current-wrong' }))).toBe('Your current password is not right.')+ expect(passkeyError(fail(403, { code: 'passkey' }))).toBe('Your passkey could not be confirmed.')+ })+})++describe('Settings: the passkey list', () => {+ it('the row counts them, and says what none means', () => {+ expect(mount(<PasskeysRow state={LIST} changed={() => {}} />).textContent).toContain('2 passkeys')+ expect(mount(<PasskeysRow state={{ ...LIST, passkeys: [LIST.passkeys[0]] }} changed={() => {}} />).textContent).toContain('1 passkey')+ expect(mount(<PasskeysRow state={{ ...LIST, passkeys: [] }} changed={() => {}} />).textContent).toMatch(/None yet/)+ expect(mount(<PasskeysRow state={null} />).textContent).toBe('')+ })++ it('lists each one by name or number, with when it was added and last used — the year only when it is not this one', async () => {+ mocks.answers['GET /api/account/passkeys'] = LIST+ const host = mount(<PasskeysSheet close={() => {}} changed={() => {}} />)+ await settle()+ const rows = [...host.querySelectorAll('.lrow')].map(r => r.textContent)+ expect(rows[0]).toMatch(/^Laptop/)+ expect(rows[0]).toMatch(/Added 1 Sept? 2025 · Last used \d+ \S+$/)+ expect(rows[0]).not.toContain(String(new Date().getFullYear()))+ expect(rows[1]).toBe('Passkey 2')+ expect(host.textContent).not.toMatch(/only way in/)+ })++ it('says why the only passkey stays, and its sheet offers no Remove', async () => {+ mocks.answers['GET /api/account/passkeys'] = { passkeys: [LIST.passkeys[0]], password: false, lastWayIn: true }+ const host = mount(<PasskeysSheet close={() => {}} changed={() => {}} />)+ await settle()+ expect(host.textContent).toMatch(/only way in/)+ act(() => host.querySelector('.lrow').click())+ const { host: edit } = openedSheet()+ expect(button(edit, 'Remove passkey')).toBeUndefined()+ expect(edit.textContent).toMatch(/only way in/)+ })++ it('renames one, and removes one only after the confirm that says sessions stay', async () => {+ mocks.answers['GET /api/account/passkeys'] = LIST+ const changed = vi.fn()+ const host = mount(<PasskeysSheet close={() => {}} changed={changed} />)+ await settle()+ act(() => host.querySelector('.lrow').click())+ const { host: edit, close } = openedSheet()+ expect(edit.querySelector('h3').textContent).toBe('Laptop')+ mocks.answers['POST /api/account/passkeys/rename'] = { ...LIST, passkeys: [{ ...LIST.passkeys[0], name: 'Work laptop' }, LIST.passkeys[1]] }+ type(byPlaceholder(edit, 'Name, e.g. Work laptop'), 'Work laptop')+ await submit(edit)+ expect(mocks.calls.at(-1)).toEqual({ path: '/api/account/passkeys/rename', method: 'POST', body: { id: 'k/1+', name: 'Work laptop' } })+ expect(close).toHaveBeenCalled()+ expect(changed).toHaveBeenCalledTimes(1)++ act(() => button(edit, 'Remove passkey').click())+ const confirm = mocks.confirmSheet.mock.calls[0][0]+ expect(confirm.message).toMatch(/stays signed in — use Sign out everywhere/)+ mocks.answers['DELETE /api/account/passkeys'] = { ...LIST, passkeys: [LIST.passkeys[1]], lastWayIn: true }+ await act(() => confirm.onConfirm())+ expect(mocks.calls.at(-1)).toEqual({ path: '/api/account/passkeys?id=k%2F1%2B', method: 'DELETE', body: null })+ expect(mocks.toast).toHaveBeenCalledWith('Passkey removed')+ expect(changed).toHaveBeenCalledTimes(2)+ })++ it('a refused removal says why', async () => {+ mocks.answers['GET /api/account/passkeys'] = LIST+ const host = mount(<PasskeysSheet close={() => {}} changed={() => {}} />)+ await settle()+ act(() => host.querySelector('.lrow').click())+ const { host: edit } = openedSheet()+ act(() => button(edit, 'Remove passkey').click())+ mocks.answers['DELETE /api/account/passkeys'] = fail(409, { code: 'last-way-in' })+ await act(() => mocks.confirmSheet.mock.calls[0][0].onConfirm())+ expect(mocks.toast).toHaveBeenCalledWith('It is your only way in, so it cannot be removed until there is another.')+ })+})++describe('Settings: adding a passkey', () => {+ async function openAdd(list) {+ mocks.answers['GET /api/account/passkeys'] = list+ const host = mount(<PasskeysSheet close={() => {}} changed={() => {}} />)+ await settle()+ await click(host, 'Add a passkey')+ return openedSheet()+ }++ it('confirms with a passkey first, then opens the passkey prompt from its own tap and stores the new one', async () => {+ const { host, close } = await openAdd(LIST)+ // No password on this profile: only the passkey proof is offered.+ expect(byPlaceholder(host, 'Current password')).toBeNull()+ type(byPlaceholder(host, 'Name, e.g. Work laptop'), 'YubiKey')+ mocks.answers['POST /api/account/passkeys/options'] = { cid: 'add-cid', options: { challenge: 'abc' } }+ await click(host, 'Confirm with a passkey')+ expect(mocks.calls.at(-1)).toEqual({ path: '/api/account/passkeys/options', method: 'POST', body: { cid: 'login-cid', credential: { id: 'k1' } } })+ // Nothing is created until the second tap.+ expect(mocks.createPasskey).not.toHaveBeenCalled()+ mocks.answers['POST /api/account/passkeys/verify'] = LIST+ await click(host, 'Create passkey')+ expect(mocks.createPasskey).toHaveBeenCalledWith({ challenge: 'abc' })+ expect(mocks.calls.at(-1)).toEqual({ path: '/api/account/passkeys/verify', method: 'POST', body: { cid: 'add-cid', credential: { id: 'new-key', response: {} }, name: 'YubiKey' } })+ expect(close).toHaveBeenCalled()+ expect(mocks.toast).toHaveBeenCalledWith('Passkey added')+ })++ it('takes the current password as proof where there is one, and says when it is wrong', async () => {+ const { host } = await openAdd({ passkeys: [], password: true, lastWayIn: true })+ expect(button(host, 'Confirm with a passkey')).toBeUndefined()+ const pw = byPlaceholder(host, 'Current password')+ expect(pw.getAttribute('autocomplete')).toBe('current-password')+ await submit(host)+ expect(alertText(host)).toBe('Enter your password.')+ mocks.answers['POST /api/account/passkeys/options'] = fail(403, { code: 'current-wrong' })+ type(pw, 'not it')+ await submit(host)+ expect(mocks.calls.at(-1).body).toEqual({ current: 'not it' })+ expect(alertText(host)).toBe('Your current password is not right.')+ })++ it('a dismissed prompt is no error; an authenticator that already holds one says so', async () => {+ const { host } = await openAdd(LIST)+ mocks.answers['POST /api/account/passkeys/options'] = { cid: 'add-cid', options: {} }+ await click(host, 'Confirm with a passkey')+ mocks.createPasskey.mockRejectedValueOnce(named('NotAllowedError'))+ await click(host, 'Create passkey')+ expect(alertText(host)).toBeNull()+ mocks.createPasskey.mockRejectedValueOnce(named('InvalidStateError'))+ await click(host, 'Create passkey')+ expect(alertText(host)).toBe('This device already has a passkey for this profile.')+ })+})++describe('Settings: a code for another device', () => {+ it('after the proof shows the code, a QR code of the link, and copies the link', async () => {+ mocks.answers['GET /api/account/passkeys'] = LIST+ mocks.answers['POST /api/account/device-link'] = { code: 'K7WQ-2MZP-4HXA', expires: Date.now() + 600000 }+ const host = mount(<DeviceLinkSheet close={() => {}} />)+ await settle()+ expect(host.querySelector('canvas')).toBeNull()+ await click(host, 'Confirm with a passkey')+ expect(mocks.calls.at(-1)).toEqual({ path: '/api/account/device-link', method: 'POST', body: { cid: 'login-cid', credential: { id: 'k1' } } })+ const link = window.location.origin + window.location.pathname + '?link=K7WQ-2MZP-4HXA'+ expect(host.querySelector('canvas').dataset.qr).toBe(link)+ expect(host.textContent).toContain('K7WQ-2MZP-4HXA')+ expect(host.textContent).toMatch(/works once, for 10 minutes/)+ await click(host, 'Copy link')+ expect(mocks.copyText).toHaveBeenCalledWith(link)+ expect(mocks.toast).toHaveBeenCalledWith('Copied')+ })++ it('says when the code has expired, and makes a new one from the start', async () => {+ mocks.answers['GET /api/account/passkeys'] = LIST+ mocks.answers['POST /api/account/device-link'] = { code: 'K7WQ-2MZP-4HXA', expires: Date.now() - 1 }+ const host = mount(<DeviceLinkSheet close={() => {}} />)+ await settle()+ await click(host, 'Confirm with a passkey')+ await settle()+ expect(host.textContent).toContain('This code has expired.')+ expect(host.querySelector('canvas')).toBeNull()+ await click(host, 'Make a new code')+ expect(button(host, 'Confirm with a passkey')).toBeTruthy()+ })+})++describe('the other device: redeeming a code', () => {+ const OPTIONS = { cid: 'link-cid', options: { challenge: 'xyz' }, name: 'Ana' }++ it('checks a code from the link at once, then creates the passkey and signs in like a passkey sign-in', async () => {+ mocks.store = { user: null, linkCode: 'K7WQ-2MZP-4HXA' }+ mocks.answers['POST /api/device-link/options'] = OPTIONS+ mocks.answers['POST /api/device-link/verify'] = { user: { id: 'u1', name: 'Ana', admin: false } }+ const close = vi.fn()+ const host = mount(<DeviceLinkRedeemSheet close={close} />)+ await settle()+ expect(mocks.calls[0]).toEqual({ path: '/api/device-link/options', method: 'POST', body: { code: 'K7WQ-2MZP-4HXA' } })+ expect(host.textContent).toContain('for the profile “Ana”')+ expect(byPlaceholder(host, 'Code from your other device').value).toBe('K7WQ-2MZP-4HXA')+ await submit(host)+ // The options already here are used as they are: the prompt opens straight from the tap.+ expect(mocks.calls.filter(c => c.path === '/api/device-link/options')).toHaveLength(1)+ expect(mocks.createPasskey).toHaveBeenCalledWith({ challenge: 'xyz' })+ expect(mocks.calls.at(-1).path).toBe('/api/device-link/verify')+ expect(mocks.calls.at(-1).body).toMatchObject({ code: 'K7WQ-2MZP-4HXA', cid: 'link-cid', credential: { id: 'new-key' } })+ expect(mocks.setUser).toHaveBeenCalledWith({ id: 'u1', name: 'Ana', admin: false })+ expect(mocks.adoptProfile).toHaveBeenCalled()+ expect(mocks.store.linkCode).toBeNull()+ expect(close).toHaveBeenCalled()+ expect(mocks.toast).toHaveBeenCalledWith('Welcome back, Ana')+ })++ it('a typed code is checked on the tap; a wrong one stays on the sheet and says so', async () => {+ mocks.store = { user: null, linkCode: null }+ mocks.answers['POST /api/device-link/options'] = fail(400, { code: 'link-invalid' })+ const host = mount(<DeviceLinkRedeemSheet close={() => {}} />)+ await settle()+ expect(mocks.calls).toHaveLength(0)+ await submit(host)+ expect(alertText(host)).toBe('Enter the code from your other device.')+ type(byPlaceholder(host, 'Code from your other device'), 'wrng-code-0000')+ await submit(host)+ expect(mocks.calls[0].body).toEqual({ code: 'WRNG-CODE-0000' })+ expect(alertText(host)).toMatch(/wrong, used or expired/)+ expect(mocks.createPasskey).not.toHaveBeenCalled()+ expect(mocks.setUser).not.toHaveBeenCalled()+ })++ it('after a refused verify it asks for fresh options next time, since the server spent the challenge', async () => {+ mocks.store = { user: null, linkCode: 'K7WQ-2MZP-4HXA' }+ mocks.answers['POST /api/device-link/options'] = OPTIONS+ mocks.answers['POST /api/device-link/verify'] = fail(400, { error: 'not verified' })+ const host = mount(<DeviceLinkRedeemSheet close={() => {}} />)+ await settle()+ await submit(host)+ expect(alertText(host)).toBe('not verified')+ await submit(host)+ expect(mocks.calls.filter(c => c.path === '/api/device-link/options')).toHaveLength(2)+ })++ it('the same account adding this browser keeps its copy as it is', async () => {+ mocks.store = { user: { id: 'u1', name: 'Ana' }, linkCode: 'K7WQ-2MZP-4HXA' }+ mocks.answers['POST /api/device-link/options'] = OPTIONS+ mocks.answers['POST /api/device-link/verify'] = { user: { id: 'u1', name: 'Ana', admin: false } }+ const host = mount(<DeviceLinkRedeemSheet close={() => {}} />)+ await settle()+ expect(host.textContent).not.toMatch(/signed in as/)+ await submit(host)+ expect(mocks.adoptProfile).not.toHaveBeenCalled()+ expect(mocks.toast).toHaveBeenCalledWith('Passkey added')+ })++ it('says so when another profile is signed in here', async () => {+ mocks.store = { user: { id: 'u2', name: 'Bea' }, linkCode: 'K7WQ-2MZP-4HXA' }+ mocks.answers['POST /api/device-link/options'] = OPTIONS+ const host = mount(<DeviceLinkRedeemSheet close={() => {}} />)+ await settle()+ expect(host.textContent).toContain('This browser is signed in as “Bea”. Adding it to “Ana” signs “Bea” out here.')+ })++ it('a browser without passkeys is told plainly, and nothing is asked of the server', async () => {+ mocks.webauthn = false+ mocks.store = { user: null, linkCode: 'K7WQ-2MZP-4HXA' }+ const host = mount(<DeviceLinkRedeemSheet close={() => {}} />)+ await settle()+ expect(host.textContent).toMatch(/cannot create passkeys/)+ expect(mocks.calls).toHaveLength(0)+ })+})diff --git a/frontend/src/components/PasswordAuth.jsx b/frontend/src/components/PasswordAuth.jsxindex 3ecc1a903..a6c309b83 100644--- a/frontend/src/components/PasswordAuth.jsx+++ b/frontend/src/components/PasswordAuth.jsx@@ -202,10 +202,12 @@ export const openPasswordRegister = () => ui().openSheet(close => <PasswordRegisceremony right now (a session on its own could be a copied cookie); a change needs thecurrent password, or the passkey when it was forgotten. Saving signs every other device out,which the sheet says before anyone taps. */-export function PasswordRow() {+// `version` changes when the profile's passkeys do (Settings, components/Passkeys.jsx): whether the+// password may be removed depends on them, so the row asks again.+export function PasswordRow({ version = 0 }) {const [st, setSt] = useState(null) // GET /api/account/passwordconst load = () => api('/api/account/password').then(setSt).catch(() => {})- useEffect(() => { load() }, [])+ useEffect(() => { load() }, [version])if (!st) return null// Nothing here could set a first password without a passkey ceremony.if (!st.set && (!webauthnOK() || !st.passkeys)) return nulldiff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.jsindex 4c41e381c..c9d7bfa9e 100644--- a/frontend/src/lib/api.js+++ b/frontend/src/lib/api.js@@ -143,6 +143,15 @@ export async function passkeyLogin() {const res = await api('/api/login/verify', { method: 'POST', body: JSON.stringify(await passkeyAssertion()) })return res.user}+// A creation ceremony on options the server has already handed out: another passkey for a+// signed-in profile, or one made with a code from another device (#95, components/Passkeys.jsx).+// The options come in an earlier step so the prompt opens straight from the tap that asks for it.+// They are copied first — the conversion writes buffers into them, and a prompt dismissed by+// mistake is tried again with the same ones.+export async function createPasskey(options) {+ const cred = await navigator.credentials.create({ publicKey: toCreationOptions(JSON.parse(JSON.stringify(options))) })+ return credToJSON(cred)+}// Name-and-password sign-in, on an instance that offers it (config.password_login). Each of// these answers with the same session cookie a passkey sign-in sets, so callers treat the userdiff --git a/frontend/src/lib/audit.js b/frontend/src/lib/audit.jsindex 64cef9606..ff126f93d 100644--- a/frontend/src/lib/audit.js+++ b/frontend/src/lib/audit.js@@ -34,6 +34,15 @@ const LABELS = {'auth.password.change': 'Changed their password','auth.password.remove': 'Removed their password','auth.password.reset': 'Used a reset code',+ // More than one passkey, and one-time codes for another device (#95). `msg` on an addition or a+ // code is the proof it was made with (passkey, password); on a removal or a redemption, the+ // passkey's name.+ 'auth.passkey.add': 'Added a passkey',+ 'auth.passkey.fail': 'Adding a passkey failed',+ 'auth.passkey.remove': 'Removed a passkey',+ 'auth.link.create': 'Made a one-time code for another device',+ 'auth.link.ok': 'Added a device with a one-time code',+ 'auth.link.fail': 'Adding a device with a code failed',// The password throttle paused an address; `msg` says for what (password, signup).'auth.throttled': 'Too many failed attempts from one address','admin.user.disable': 'Disabled an account',@@ -60,15 +69,18 @@ const REASONS = {'invite-invalid': 'the invite code was used or revoked in the meantime','invite-rejected': 'wrong or already-used invite code','code-invalid': 'wrong or expired pairing code',- 'user-unavailable': 'the profile behind the pairing code is disabled or gone',+ 'user-unavailable': 'the profile behind the code is disabled or gone','bad-password': 'wrong password','bad-current': 'wrong current password while changing it','unknown-name': 'no profile with a password has that name',- 'step-up-failed': 'the passkey confirming a new password was rejected',+ 'step-up-failed': 'the passkey confirming the change was rejected','reset-invalid': 'wrong or expired reset code',+ 'link-invalid': 'wrong, used or expired device code',+ 'passkey-limit': 'the profile already has as many passkeys as it can hold',// What an `auth.throttled` pause was for.'password': 'wrong passwords or reset codes',- 'signup': 'wrong invite codes on password signup'+ 'signup': 'wrong invite codes on password signup',+ 'link': 'wrong one-time device codes'}export const auditReason = msg => REASONS[msg] || (msg ? String(msg) : '')diff --git a/frontend/src/lib/audit.test.js b/frontend/src/lib/audit.test.jsindex c33a1031e..2384cbcb0 100644--- a/frontend/src/lib/audit.test.js+++ b/frontend/src/lib/audit.test.js@@ -50,6 +50,7 @@ describe('auditReason', () => {it('says what a throttle pause was for, including the kind the server passes in a variable', () => {expect(auditLine({ ev: 'auth.throttled', ok: false, msg: 'signup' }).sub).toMatch(/invite codes/)expect(auditLine({ ev: 'auth.throttled', ok: false, msg: 'password' }).sub).toMatch(/wrong passwords/)+ expect(auditLine({ ev: 'auth.throttled', ok: false, msg: 'link' }).sub).toMatch(/device codes/)})it('falls back to the raw code and tolerates none at all', () => {expect(auditReason('brand-new-code')).toBe('brand-new-code')@@ -66,6 +67,14 @@ describe('auditLine', () => {expect(auditLine({ ev: 'auth.pair.ok', ok: true, name: 'Verifier' })).toEqual({ title: 'Paired a phone', sub: 'Verifier' })})+ it('reads the passkey and device-code events, including the refusals passed on from passkeys-store.js (#95)', () => {+ expect(EVENTS).toEqual(expect.arrayContaining(['auth.passkey.add', 'auth.passkey.remove', 'auth.link.create', 'auth.link.ok', 'auth.link.fail']))+ expect(auditLine({ ev: 'auth.link.fail', ok: false, msg: 'link-invalid' })).toEqual({ title: 'Adding a device with a code failed', sub: 'unknown caller · wrong, used or expired device code' })+ expect(auditLine({ ev: 'auth.passkey.fail', ok: false, name: 'Ana', msg: 'passkey-limit' }).sub).toBe('Ana · the profile already has as many passkeys as it can hold')+ expect(auditLine({ ev: 'auth.passkey.add', ok: true, name: 'Ana', msg: 'password' })).toEqual({ title: 'Added a passkey', sub: 'Ana · password' })+ expect(auditLine({ ev: 'auth.passkey.fail', ok: false, name: 'Ana', msg: 'credential-exists' }).sub).not.toMatch(/credential-exists/)+ })+it('names the person who did it', () => {expect(auditLine({ ev: 'auth.login.ok', ok: true, uid: 'u1', name: 'Duarte' })).toEqual({ title: 'Signed in', sub: 'Duarte' })diff --git a/frontend/src/lib/device-link.js b/frontend/src/lib/device-link.jsindex eaff8528d..604ebccc7 100644--- a/frontend/src/lib/device-link.js+++ b/frontend/src/lib/device-link.js@@ -1,5 +1,9 @@// Device-link URL is origin + ?link=TOKEN. HashRouter never sees that query, so we read// window.location.search directly rather than the router.+//+// The token is the one-time code a signed-in device shows (components/Passkeys.jsx, #95): the+// QR code carries this link, and opening it on the other device lands on the sheet that redeems+// the code there.export function linkTokenFromSearch(search) {return new URLSearchParams(search.startsWith('?') ? search.slice(1) : search).get('link') || ''@@ -13,3 +17,25 @@ export function stripLinkFromUrl() {const q = u.searchParams.toString()history.replaceState({}, '', u.pathname + (q ? '?' + q : '') + u.hash)}++// The link for a code: this app's own address, a subpath deployment included, which is also the+// only origin a passkey for this instance can be created on. Built here rather than by the server,+// which knows its ORIGIN but not the path the app is served under.+export function deviceLinkUrl(code, loc = window.location) {+ return loc.origin + loc.pathname + '?link=' + encodeURIComponent(code)+}++// A first name for a new passkey, from the browser that makes it — "Chrome · Android",+// "Safari · iPhone" — so a list of several says which is which without anyone typing. Product+// names only, nothing to translate; the owner can rename it. Empty when nothing is recognised.+export function deviceLabel(ua = typeof navigator === 'undefined' ? '' : navigator.userAgent) {+ const s = String(ua || '')+ const os = /iPhone/.test(s) ? 'iPhone' : /iPad/.test(s) ? 'iPad' : /Android/.test(s) ? 'Android'+ : /CrOS/.test(s) ? 'ChromeOS' : /Macintosh|Mac OS X/.test(s) ? 'Mac' : /Windows/.test(s) ? 'Windows'+ : /Linux/.test(s) ? 'Linux' : ''+ // Order matters: every Chromium browser says "Chrome", and Chrome says "Safari".+ const browser = /Edg(e|A|iOS)?\//.test(s) ? 'Edge' : /OPR\/|Opera/.test(s) ? 'Opera'+ : /SamsungBrowser/.test(s) ? 'Samsung Internet' : /Firefox\/|FxiOS/.test(s) ? 'Firefox'+ : /Chrome\/|CriOS/.test(s) ? 'Chrome' : /Safari\//.test(s) ? 'Safari' : ''+ return [browser, os].filter(Boolean).join(' · ')+}diff --git a/frontend/src/lib/device-link.test.js b/frontend/src/lib/device-link.test.jsindex 7b706e6da..deccaf9b2 100644--- a/frontend/src/lib/device-link.test.js+++ b/frontend/src/lib/device-link.test.js@@ -1,5 +1,5 @@import { describe, expect, it } from 'vitest'-import { linkTokenFromSearch } from './device-link.js'+import { linkTokenFromSearch, deviceLinkUrl, deviceLabel } from './device-link.js'describe('linkTokenFromSearch', () => {it('reads ?link= from the query string', () => {@@ -15,3 +15,36 @@ describe('linkTokenFromSearch', () => {expect(linkTokenFromSearch('?link=abc%2B1')).toBe('abc+1')})})++describe('deviceLinkUrl', () => {+ it('puts the code on the app’s own address as ?link=, and reads back to the same code', () => {+ const url = deviceLinkUrl('K7WQ-2MZP-4HXA', { origin: 'https://gym.example.com', pathname: '/' })+ expect(url).toBe('https://gym.example.com/?link=K7WQ-2MZP-4HXA')+ expect(linkTokenFromSearch(new URL(url).search)).toBe('K7WQ-2MZP-4HXA')+ })++ it('keeps a subpath deployment’s path and drops whatever query or route the page had', () => {+ expect(deviceLinkUrl('A+B', { origin: 'https://example.com', pathname: '/gym/', search: '?x=1', hash: '#/settings' }))+ .toBe('https://example.com/gym/?link=A%2BB')+ })+})++describe('deviceLabel', () => {+ const cases = [+ ['Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Mobile Safari/537.36', 'Chrome · Android'],+ ['Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1', 'Safari · iPhone'],+ ['Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/128.0 Mobile/15E148 Safari/604.1', 'Chrome · iPhone'],+ ['Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0', 'Edge · Windows'],+ ['Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0', 'Firefox · Windows'],+ ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15', 'Safari · Mac'],+ ['Mozilla/5.0 (Linux; Android 14; SM-S918B) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/25.0 Chrome/121.0.0.0 Mobile Safari/537.36', 'Samsung Internet · Android'],+ ['Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', 'Chrome · ChromeOS'],+ ['Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0', 'Firefox · Linux']+ ]+ it.each(cases)('names %s', (ua, label) => expect(deviceLabel(ua)).toBe(label))++ it('says nothing about a browser it does not recognise', () => {+ expect(deviceLabel('curl/8.0')).toBe('')+ expect(deviceLabel('')).toBe('')+ })+})diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 3f22d8902..27b4b0235 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -1533,4 +1533,45 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'رمز إعادة التعيين هذا خاطئ أو منتهي الصلاحية — اطلب رمزًا جديدًا من المسؤول.','This account has been disabled.': 'تم تعطيل هذا الحساب.','The server is busy — try again in a moment.': 'الخادم مشغول — حاول مرة أخرى بعد لحظة.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': 'مفتاح مرور واحد',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'يتيح رمز لمرة واحدة لهاتفك أو لحاسوب آخر تسجيل الدخول بمفتاح مرور خاص به.',+ 'Add a passkey': 'إضافة مفتاح مرور',+ 'Add another device': 'إضافة جهاز آخر',+ 'Add this device': 'إضافة هذا الجهاز',+ 'Added {0}': 'أُضيف في {0}',+ 'Code from your other device': 'الرمز من جهازك الآخر',+ 'Confirm with a passkey': 'التأكيد بمفتاح مرور',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'تم التأكيد. أنشئ الآن مفتاح المرور الجديد — سيسألك المتصفح أين يحفظه.',+ 'Copy link': 'نسخ الرابط',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'أنشئ على هذا الجهاز مفتاح مرور للملف الشخصي «{0}». من الآن فصاعدًا تسجّل الدخول به هنا.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'كل مفتاح يسجّل الدخول إلى هذا الملف الشخصي من الجهاز أو مدير كلمات المرور الذي يحفظه. اضغط على أحدها لإعادة تسميته أو إزالته.',+ 'Enter the code from your other device.': 'أدخل الرمز من جهازك الآخر.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'أدخل الرمز الذي يعرضه جهازك الآخر في الإعدادات ← إضافة جهاز آخر. سيحصل هذا الجهاز بعدها على مفتاح مرور خاص به.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'لهذا الجهاز، أو مفتاح أمان، أو مدير كلمات مرور، أو هاتفك عبر رمز QR الخاص بالمتصفح نفسه. أكّد أولًا أنك أنت.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'لن يعود بالإمكان تسجيل الدخول به إلى هذا الملف الشخصي. أي جهاز سجّل الدخول به بالفعل يبقى مسجّلًا — استخدم «تسجيل الخروج من كل الأجهزة» إن فُقد.',+ 'It is your only way in, so it cannot be removed until there is another.': 'إنه طريقتك الوحيدة للدخول، لذا لا يمكن إزالته حتى تتوفر طريقة أخرى.',+ 'Last used {0}': 'آخر استخدام في {0}',+ 'Make a new code': 'إنشاء رمز جديد',+ 'Name, e.g. Work laptop': 'الاسم، مثل: حاسوب العمل',+ 'None yet — add one to sign in without your password.': 'لا يوجد بعد — أضف مفتاحًا لتسجيل الدخول دون كلمة المرور.',+ 'Passkey added': 'تمت إضافة مفتاح المرور',+ 'Passkey removed': 'تمت إزالة مفتاح المرور',+ 'Passkey {0}': 'مفتاح المرور {0}',+ 'Passkeys': 'مفاتيح المرور',+ 'Remove passkey': 'إزالة مفتاح المرور',+ 'Remove this passkey?': 'إزالة مفتاح المرور هذا؟',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'امسح هذا بالجهاز الآخر، أو افتح openGym هناك وأدخل الرمز في شاشة تسجيل الدخول. يعمل مرة واحدة، لمدة {0} دقائق.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'هذا الرمز خاطئ أو مستخدَم أو منتهي الصلاحية — أنشئ رمزًا جديدًا على جهازك الآخر.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'لا يستطيع هذا المتصفح التأكيد بمفتاح المرور الخاص بك. افعل ذلك على جهاز يحفظ مفتاحًا.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'لا يستطيع هذا المتصفح إنشاء مفاتيح مرور، لذا لا يمكن إضافته برمز. افتح الرابط في متصفح يستطيع ذلك.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'هذا المتصفح مسجّل الدخول باسم «{0}». إضافته إلى «{1}» تُخرج «{0}» من هنا.',+ 'This code has expired.': 'انتهت صلاحية هذا الرمز.',+ 'This device already has a passkey for this profile.': 'لدى هذا الجهاز مفتاح مرور لهذا الملف الشخصي بالفعل.',+ 'This passkey already belongs to a profile.': 'مفتاح المرور هذا مرتبط بملف شخصي بالفعل.',+ 'This profile already has as many passkeys as it can hold.': 'بلغ هذا الملف الشخصي الحد الأقصى من مفاتيح المرور.',+ 'Use a code from your other device': 'استخدام رمز من جهازك الآخر',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'ستحصل على رمز يتيح لهاتفك أو لحاسوب آخر إنشاء مفتاح مرور لهذا الملف الشخصي. أكّد أولًا أنك أنت.',+ 'or with your password': 'أو بكلمة المرور',+ '{0} passkeys': 'مفاتيح المرور: {0}',}diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex a7805d1e7..77d7a3a19 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -353,6 +353,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Dieser Reset-Code ist falsch oder abgelaufen — bitte deinen Admin um einen neuen.','This account has been disabled.': 'Dieses Konto wurde deaktiviert.','The server is busy — try again in a moment.': 'Der Server ist ausgelastet — versuch es gleich noch einmal.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 Passkey',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Mit einem Einmal-Code meldet sich dein Handy oder ein anderer Computer mit einem eigenen Passkey an.',+ 'Add a passkey': 'Passkey hinzufügen',+ 'Add another device': 'Weiteres Gerät hinzufügen',+ 'Add this device': 'Dieses Gerät hinzufügen',+ 'Added {0}': 'Hinzugefügt am {0}',+ 'Code from your other device': 'Code von deinem anderen Gerät',+ 'Confirm with a passkey': 'Mit einem Passkey bestätigen',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Bestätigt. Erstelle jetzt den neuen Passkey — dein Browser fragt, wo er gespeichert werden soll.',+ 'Copy link': 'Link kopieren',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Erstelle auf diesem Gerät einen Passkey für das Profil „{0}“. Damit meldest du dich hier ab jetzt an.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Jeder meldet dich bei diesem Profil an, von dem Gerät oder Passwort-Manager aus, in dem er gespeichert ist. Tippe auf einen, um ihn umzubenennen oder zu entfernen.',+ 'Enter the code from your other device.': 'Gib den Code von deinem anderen Gerät ein.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Gib den Code ein, den dein anderes Gerät unter Einstellungen → Weiteres Gerät hinzufügen zeigt. Dieses Gerät bekommt dann einen eigenen Passkey.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Für dieses Gerät, einen Sicherheitsschlüssel, einen Passwort-Manager oder dein Handy über den QR-Code des Browsers. Bestätige zuerst, dass du es bist.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Mit ihm kann sich niemand mehr bei diesem Profil anmelden. Ein Gerät, das damit schon angemeldet ist, bleibt angemeldet — nutze „Überall abmelden“, falls es verloren gegangen ist.',+ 'It is your only way in, so it cannot be removed until there is another.': 'Er ist dein einziger Weg ins Profil und lässt sich deshalb erst entfernen, wenn es einen weiteren gibt.',+ 'Last used {0}': 'Zuletzt benutzt am {0}',+ 'Make a new code': 'Neuen Code erstellen',+ 'Name, e.g. Work laptop': 'Name, z. B. Arbeitslaptop',+ 'None yet — add one to sign in without your password.': 'Noch keiner — füge einen hinzu, um dich ohne Passwort anzumelden.',+ 'Passkey added': 'Passkey hinzugefügt',+ 'Passkey removed': 'Passkey entfernt',+ 'Passkey {0}': 'Passkey {0}',+ 'Passkeys': 'Passkeys',+ 'Remove passkey': 'Passkey entfernen',+ 'Remove this passkey?': 'Diesen Passkey entfernen?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Scanne das mit dem anderen Gerät, oder öffne dort openGym und gib den Code auf dem Anmeldebildschirm ein. Er funktioniert einmal, {0} Minuten lang.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Dieser Code ist falsch, schon benutzt oder abgelaufen — erstelle auf deinem anderen Gerät einen neuen.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Dieser Browser kann nicht mit deinem Passkey bestätigen. Mach das auf einem Gerät, auf dem einer gespeichert ist.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Dieser Browser kann keine Passkeys erstellen und lässt sich deshalb nicht per Code hinzufügen. Öffne den Link in einem Browser, der das kann.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Dieser Browser ist als „{0}“ angemeldet. Wenn du ihn zu „{1}“ hinzufügst, wird „{0}“ hier abgemeldet.',+ 'This code has expired.': 'Dieser Code ist abgelaufen.',+ 'This device already has a passkey for this profile.': 'Dieses Gerät hat schon einen Passkey für dieses Profil.',+ 'This passkey already belongs to a profile.': 'Dieser Passkey gehört schon zu einem Profil.',+ 'This profile already has as many passkeys as it can hold.': 'Dieses Profil hat schon so viele Passkeys, wie es haben kann.',+ 'Use a code from your other device': 'Code von deinem anderen Gerät verwenden',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Du bekommst einen Code, mit dem dein Handy oder ein anderer Computer einen Passkey für dieses Profil erstellen kann. Bestätige zuerst, dass du es bist.',+ 'or with your password': 'oder mit deinem Passwort',+ '{0} passkeys': '{0} Passkeys','Each profile keeps its own plan, workouts & body weight.': 'Jedes Profil hat seinen eigenen Plan, Trainings & Körpergewicht.',// --- settings ---'Account': 'Konto',diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 395bd6814..2d439f38c 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Ese código de restablecimiento es incorrecto o ha caducado — pide uno nuevo a tu administrador.','This account has been disabled.': 'Esta cuenta ha sido desactivada.','The server is busy — try again in a moment.': 'El servidor está ocupado — inténtalo de nuevo en un momento.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 passkey',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Un código de un solo uso permite que tu teléfono u otro ordenador inicie sesión con una passkey propia.',+ 'Add a passkey': 'Añadir una passkey',+ 'Add another device': 'Añadir otro dispositivo',+ 'Add this device': 'Añadir este dispositivo',+ 'Added {0}': 'Añadida el {0}',+ 'Code from your other device': 'Código de tu otro dispositivo',+ 'Confirm with a passkey': 'Confirmar con una passkey',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Confirmado. Ahora crea la passkey nueva — tu navegador te pregunta dónde guardarla.',+ 'Copy link': 'Copiar enlace',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Crea en este dispositivo una passkey para el perfil «{0}». Con ella inicias sesión aquí a partir de ahora.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Cada una inicia sesión en este perfil desde el dispositivo o el gestor de contraseñas que la guarda. Toca una para cambiarle el nombre o quitarla.',+ 'Enter the code from your other device.': 'Introduce el código de tu otro dispositivo.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Introduce el código que muestra tu otro dispositivo en Ajustes → Añadir otro dispositivo. Este dispositivo tendrá entonces su propia passkey.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Para este dispositivo, una llave de seguridad, un gestor de contraseñas o tu teléfono mediante el código QR del propio navegador. Primero confirma que eres tú.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Ya no podrá iniciar sesión en este perfil. Un dispositivo que ya inició sesión con ella sigue conectado — usa «Cerrar sesión en todos los dispositivos» si se perdió.',+ 'It is your only way in, so it cannot be removed until there is another.': 'Es tu única forma de entrar, así que no se puede quitar hasta que haya otra.',+ 'Last used {0}': 'Usada por última vez el {0}',+ 'Make a new code': 'Crear un código nuevo',+ 'Name, e.g. Work laptop': 'Nombre, p. ej. Portátil del trabajo',+ 'None yet — add one to sign in without your password.': 'Ninguna todavía — añade una para iniciar sesión sin tu contraseña.',+ 'Passkey added': 'Passkey añadida',+ 'Passkey removed': 'Passkey quitada',+ 'Passkey {0}': 'Passkey {0}',+ 'Passkeys': 'Passkeys',+ 'Remove passkey': 'Quitar passkey',+ 'Remove this passkey?': '¿Quitar esta passkey?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Escanea esto con el otro dispositivo, o abre openGym allí e introduce el código en la pantalla de inicio de sesión. Funciona una vez, durante {0} minutos.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Ese código es incorrecto, ya se usó o ha caducado — crea uno nuevo en tu otro dispositivo.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Este navegador no puede confirmar con tu passkey. Hazlo en un dispositivo que tenga una.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Este navegador no puede crear passkeys, así que no se puede añadir con un código. Abre el enlace en un navegador que pueda.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Este navegador tiene la sesión iniciada como «{0}». Añadirlo a «{1}» cierra aquí la sesión de «{0}».',+ 'This code has expired.': 'Este código ha caducado.',+ 'This device already has a passkey for this profile.': 'Este dispositivo ya tiene una passkey para este perfil.',+ 'This passkey already belongs to a profile.': 'Esta passkey ya pertenece a un perfil.',+ 'This profile already has as many passkeys as it can hold.': 'Este perfil ya tiene todas las passkeys que puede tener.',+ 'Use a code from your other device': 'Usar un código de tu otro dispositivo',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Recibes un código con el que tu teléfono u otro ordenador puede crear una passkey para este perfil. Primero confirma que eres tú.',+ 'or with your password': 'o con tu contraseña',+ '{0} passkeys': '{0} passkeys','Each profile keeps its own plan, workouts & body weight.': 'Cada perfil guarda su propio plan, entrenamientos y peso corporal.','Account': 'Cuenta','Sign out?': '¿Cerrar sesión?',diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 72e03fb18..9ac14efee 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Ce code de réinitialisation est faux ou a expiré — demande-en un nouveau à ton administrateur.','This account has been disabled.': 'Ce compte a été désactivé.','The server is busy — try again in a moment.': 'Le serveur est occupé — réessaie dans un instant.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 passkey',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Un code à usage unique permet à ton téléphone ou à un autre ordinateur de se connecter avec sa propre passkey.',+ 'Add a passkey': 'Ajouter une passkey',+ 'Add another device': 'Ajouter un autre appareil',+ 'Add this device': 'Ajouter cet appareil',+ 'Added {0}': 'Ajoutée le {0}',+ 'Code from your other device': 'Code de ton autre appareil',+ 'Confirm with a passkey': 'Confirmer avec une passkey',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Confirmé. Crée maintenant la nouvelle passkey — ton navigateur te demande où la garder.',+ 'Copy link': 'Copier le lien',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Crée sur cet appareil une passkey pour le profil « {0} ». C’est avec elle que tu te connectes ici désormais.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Chacune te connecte à ce profil depuis l’appareil ou le gestionnaire de mots de passe qui la garde. Touches-en une pour la renommer ou la retirer.',+ 'Enter the code from your other device.': 'Saisis le code de ton autre appareil.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Saisis le code que ton autre appareil affiche dans Réglages → Ajouter un autre appareil. Cet appareil reçoit alors sa propre passkey.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Pour cet appareil, une clé de sécurité, un gestionnaire de mots de passe, ou ton téléphone via le code QR du navigateur lui-même. Confirme d’abord que c’est bien toi.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Elle ne pourra plus se connecter à ce profil. Un appareil déjà connecté avec elle le reste — utilise « Se déconnecter partout » s’il a été perdu.',+ 'It is your only way in, so it cannot be removed until there is another.': 'C’est ton seul moyen d’entrer, elle ne peut donc pas être retirée tant qu’il n’y en a pas d’autre.',+ 'Last used {0}': 'Utilisée pour la dernière fois le {0}',+ 'Make a new code': 'Créer un nouveau code',+ 'Name, e.g. Work laptop': 'Nom, p. ex. Portable du travail',+ 'None yet — add one to sign in without your password.': 'Aucune pour l’instant — ajoutes-en une pour te connecter sans ton mot de passe.',+ 'Passkey added': 'Passkey ajoutée',+ 'Passkey removed': 'Passkey retirée',+ 'Passkey {0}': 'Passkey {0}',+ 'Passkeys': 'Passkeys',+ 'Remove passkey': 'Retirer la passkey',+ 'Remove this passkey?': 'Retirer cette passkey ?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Scanne ceci avec l’autre appareil, ou ouvre openGym dessus et saisis le code sur l’écran de connexion. Il fonctionne une fois, pendant {0} minutes.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Ce code est faux, déjà utilisé ou expiré — crées-en un nouveau sur ton autre appareil.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Ce navigateur ne peut pas confirmer avec ta passkey. Fais-le sur un appareil qui en garde une.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Ce navigateur ne peut pas créer de passkeys, il ne peut donc pas être ajouté avec un code. Ouvre le lien dans un navigateur qui le peut.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Ce navigateur est connecté en tant que « {0} ». L’ajouter à « {1} » déconnecte « {0} » ici.',+ 'This code has expired.': 'Ce code a expiré.',+ 'This device already has a passkey for this profile.': 'Cet appareil a déjà une passkey pour ce profil.',+ 'This passkey already belongs to a profile.': 'Cette passkey appartient déjà à un profil.',+ 'This profile already has as many passkeys as it can hold.': 'Ce profil a déjà autant de passkeys qu’il peut en avoir.',+ 'Use a code from your other device': 'Utiliser un code de ton autre appareil',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Tu reçois un code qui permet à ton téléphone ou à un autre ordinateur de créer une passkey pour ce profil. Confirme d’abord que c’est bien toi.',+ 'or with your password': 'ou avec ton mot de passe',+ '{0} passkeys': '{0} passkeys','Each profile keeps its own plan, workouts & body weight.': 'Chaque profil garde son plan, ses séances et son poids corporel.','Account': 'Compte','Sign out?': 'Se déconnecter ?',diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex e22ca3d11..0127e1695 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'यह रीसेट कोड गलत है या इसकी अवधि समाप्त हो गई है — अपने एडमिन से नया कोड माँगें।','This account has been disabled.': 'यह खाता निष्क्रिय कर दिया गया है।','The server is busy — try again in a moment.': 'सर्वर व्यस्त है — थोड़ी देर में फिर से कोशिश करें।',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 पासकी',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'एक बार इस्तेमाल होने वाला कोड आपके फ़ोन या किसी दूसरे कंप्यूटर को उसकी अपनी पासकी से साइन इन करने देता है।',+ 'Add a passkey': 'पासकी जोड़ें',+ 'Add another device': 'दूसरा डिवाइस जोड़ें',+ 'Add this device': 'यह डिवाइस जोड़ें',+ 'Added {0}': '{0} को जोड़ी गई',+ 'Code from your other device': 'आपके दूसरे डिवाइस का कोड',+ 'Confirm with a passkey': 'पासकी से पुष्टि करें',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'पुष्टि हो गई। अब नई पासकी बनाएँ — आपका ब्राउज़र पूछेगा कि इसे कहाँ रखना है।',+ 'Copy link': 'लिंक कॉपी करें',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'इस डिवाइस पर प्रोफ़ाइल "{0}" के लिए पासकी बनाएँ। अब से आप यहाँ इसी से साइन इन करेंगे।',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'हर पासकी उस डिवाइस या पासवर्ड मैनेजर से इस प्रोफ़ाइल में साइन इन करती है जिसमें वह रखी है। नाम बदलने या हटाने के लिए किसी पर टैप करें।',+ 'Enter the code from your other device.': 'अपने दूसरे डिवाइस का कोड दर्ज करें।',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'वह कोड दर्ज करें जो आपका दूसरा डिवाइस सेटिंग्स → दूसरा डिवाइस जोड़ें में दिखाता है। फिर इस डिवाइस को अपनी पासकी मिल जाएगी।',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'इस डिवाइस, सिक्योरिटी की, पासवर्ड मैनेजर, या ब्राउज़र के अपने QR कोड के ज़रिए आपके फ़ोन के लिए। पहले पुष्टि करें कि यह आप ही हैं।',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'इससे अब इस प्रोफ़ाइल में साइन इन नहीं हो सकेगा। जो डिवाइस इससे पहले से साइन इन है, वह साइन इन ही रहेगा — अगर वह खो गया हो तो "हर जगह साइन आउट करें" इस्तेमाल करें।',+ 'It is your only way in, so it cannot be removed until there is another.': 'यह अंदर आने का आपका एकमात्र तरीका है, इसलिए जब तक कोई दूसरा न हो, इसे हटाया नहीं जा सकता।',+ 'Last used {0}': 'आख़िरी बार {0} को इस्तेमाल हुई',+ 'Make a new code': 'नया कोड बनाएँ',+ 'Name, e.g. Work laptop': 'नाम, जैसे ऑफ़िस लैपटॉप',+ 'None yet — add one to sign in without your password.': 'अभी कोई नहीं — बिना पासवर्ड के साइन इन करने के लिए एक जोड़ें।',+ 'Passkey added': 'पासकी जोड़ी गई',+ 'Passkey removed': 'पासकी हटाई गई',+ 'Passkey {0}': 'पासकी {0}',+ 'Passkeys': 'पासकी',+ 'Remove passkey': 'पासकी हटाएँ',+ 'Remove this passkey?': 'यह पासकी हटाएँ?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'इसे दूसरे डिवाइस से स्कैन करें, या वहाँ openGym खोलकर साइन-इन स्क्रीन पर कोड दर्ज करें। यह एक बार, {0} मिनट तक काम करता है।',+ 'That code is wrong, used or expired — make a new one on your other device.': 'यह कोड गलत है, इस्तेमाल हो चुका है या समाप्त हो गया है — अपने दूसरे डिवाइस पर नया बनाएँ।',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'यह ब्राउज़र आपकी पासकी से पुष्टि नहीं कर सकता। यह काम उस डिवाइस पर करें जिसमें पासकी रखी है।',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'यह ब्राउज़र पासकी नहीं बना सकता, इसलिए इसे कोड से नहीं जोड़ा जा सकता। लिंक ऐसे ब्राउज़र में खोलें जो पासकी बना सके।',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'यह ब्राउज़र "{0}" के रूप में साइन इन है। इसे "{1}" में जोड़ने से यहाँ "{0}" साइन आउट हो जाएगा।',+ 'This code has expired.': 'यह कोड समाप्त हो चुका है।',+ 'This device already has a passkey for this profile.': 'इस डिवाइस में इस प्रोफ़ाइल की पासकी पहले से है।',+ 'This passkey already belongs to a profile.': 'यह पासकी पहले से किसी प्रोफ़ाइल की है।',+ 'This profile already has as many passkeys as it can hold.': 'इस प्रोफ़ाइल में पहले से ही जितनी हो सकती हैं उतनी पासकी हैं।',+ 'Use a code from your other device': 'अपने दूसरे डिवाइस का कोड इस्तेमाल करें',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'आपको एक कोड मिलेगा जिससे आपका फ़ोन या कोई दूसरा कंप्यूटर इस प्रोफ़ाइल के लिए पासकी बना सकता है। पहले पुष्टि करें कि यह आप ही हैं।',+ 'or with your password': 'या अपने पासवर्ड से',+ '{0} passkeys': '{0} पासकी','Each profile keeps its own plan, workouts & body weight.': 'हर प्रोफ़ाइल की अपनी योजना, वर्कआउट और वज़न होते हैं।','Account': 'खाता','Sign out?': 'साइन आउट करें?',diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 1bea0f028..f3cf85e22 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -345,6 +345,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Ez a visszaállító kód hibás vagy lejárt — kérj újat az adminisztrátortól.','This account has been disabled.': 'Ezt a fiókot letiltották.','The server is busy — try again in a moment.': 'A szerver foglalt — próbáld újra egy pillanat múlva.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 jelszókulcs',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Egy egyszer használható kóddal a telefonod vagy egy másik számítógép saját jelszókulccsal jelentkezhet be.',+ 'Add a passkey': 'Jelszókulcs hozzáadása',+ 'Add another device': 'Másik eszköz hozzáadása',+ 'Add this device': 'Az eszköz hozzáadása',+ 'Added {0}': 'Hozzáadva: {0}',+ 'Code from your other device': 'Kód a másik eszközödről',+ 'Confirm with a passkey': 'Megerősítés jelszókulccsal',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Megerősítve. Most hozd létre az új jelszókulcsot — a böngésző megkérdezi, hol tárolja.',+ 'Copy link': 'Link másolása',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Hozz létre ezen az eszközön egy jelszókulcsot a(z) „{0}” profilhoz. Mostantól ezzel jelentkezel be itt.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Mindegyik abból az eszközből vagy jelszókezelőből jelentkeztet be ebbe a profilba, amelyik tárolja. Koppints egyre az átnevezéséhez vagy eltávolításához.',+ 'Enter the code from your other device.': 'Add meg a kódot a másik eszközödről.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Add meg a kódot, amelyet a másik eszközöd a Beállítások → Másik eszköz hozzáadása alatt mutat. Ez az eszköz ezután saját jelszókulcsot kap.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Ehhez az eszközhöz, biztonsági kulcshoz, jelszókezelőhöz vagy a telefonodhoz a böngésző saját QR-kódján keresztül. Előbb erősítsd meg, hogy te vagy az.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Ezzel többé nem lehet belépni ebbe a profilba. Az az eszköz, amelyik már be van vele jelentkezve, bejelentkezve marad — ha elveszett, használd a „Kijelentkezés mindenhonnan” lehetőséget.',+ 'It is your only way in, so it cannot be removed until there is another.': 'Ez az egyetlen módod a belépésre, ezért addig nem távolítható el, amíg nincs másik.',+ 'Last used {0}': 'Utoljára használva: {0}',+ 'Make a new code': 'Új kód létrehozása',+ 'Name, e.g. Work laptop': 'Név, pl. Munkahelyi laptop',+ 'None yet — add one to sign in without your password.': 'Még nincs — adj hozzá egyet, hogy jelszó nélkül jelentkezhess be.',+ 'Passkey added': 'Jelszókulcs hozzáadva',+ 'Passkey removed': 'Jelszókulcs eltávolítva',+ 'Passkey {0}': 'Jelszókulcs {0}',+ 'Passkeys': 'Jelszókulcsok',+ 'Remove passkey': 'Jelszókulcs eltávolítása',+ 'Remove this passkey?': 'Eltávolítod ezt a jelszókulcsot?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Olvasd be a másik eszközzel, vagy nyisd meg ott az openGymet, és add meg a kódot a bejelentkezési képernyőn. Egyszer működik, {0} percig.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Ez a kód hibás, már felhasználták, vagy lejárt — hozz létre egy újat a másik eszközödön.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Ez a böngésző nem tud megerősíteni a jelszókulcsoddal. Tedd ezt egy olyan eszközön, amelyik tárol egyet.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Ez a böngésző nem tud jelszókulcsot létrehozni, ezért kóddal sem adható hozzá. Nyisd meg a linket egy olyan böngészőben, amelyik képes rá.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Ez a böngésző „{0}” néven van bejelentkezve. Ha hozzáadod a(z) „{1}” profilhoz, „{0}” itt kijelentkezik.',+ 'This code has expired.': 'Ez a kód lejárt.',+ 'This device already has a passkey for this profile.': 'Ezen az eszközön már van jelszókulcs ehhez a profilhoz.',+ 'This passkey already belongs to a profile.': 'Ez a jelszókulcs már egy profilhoz tartozik.',+ 'This profile already has as many passkeys as it can hold.': 'Ennek a profilnak már annyi jelszókulcsa van, amennyi lehet.',+ 'Use a code from your other device': 'Kód használata a másik eszközödről',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Kapsz egy kódot, amellyel a telefonod vagy egy másik számítógép jelszókulcsot hozhat létre ehhez a profilhoz. Előbb erősítsd meg, hogy te vagy az.',+ 'or with your password': 'vagy a jelszavaddal',+ '{0} passkeys': '{0} jelszókulcs','Each profile keeps its own plan, workouts & body weight.': 'Minden profil megőrzi a saját tervét, edzéseit és testsúlyát.',// --- settings ---'Account': 'Fiók',diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex 25b8cd4fa..b9ba37fcf 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Questo codice di reimpostazione è sbagliato o scaduto — chiedine uno nuovo al tuo amministratore.','This account has been disabled.': 'Questo account è stato disattivato.','The server is busy — try again in a moment.': 'Il server è occupato — riprova tra un momento.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 passkey',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Un codice monouso permette al tuo telefono o a un altro computer di accedere con una passkey tutta sua.',+ 'Add a passkey': 'Aggiungi una passkey',+ 'Add another device': 'Aggiungi un altro dispositivo',+ 'Add this device': 'Aggiungi questo dispositivo',+ 'Added {0}': 'Aggiunta il {0}',+ 'Code from your other device': 'Codice dall’altro dispositivo',+ 'Confirm with a passkey': 'Conferma con una passkey',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Confermato. Ora crea la nuova passkey — il browser ti chiede dove conservarla.',+ 'Copy link': 'Copia link',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Crea su questo dispositivo una passkey per il profilo «{0}». D’ora in poi accedi qui con quella.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Ognuna accede a questo profilo dal dispositivo o dal gestore di password che la conserva. Toccane una per rinominarla o rimuoverla.',+ 'Enter the code from your other device.': 'Inserisci il codice dell’altro dispositivo.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Inserisci il codice che il tuo altro dispositivo mostra in Impostazioni → Aggiungi un altro dispositivo. Questo dispositivo avrà poi una passkey tutta sua.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Per questo dispositivo, una chiave di sicurezza, un gestore di password o il tuo telefono tramite il codice QR del browser stesso. Prima conferma che sei tu.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Non potrà più accedere a questo profilo. Un dispositivo che ha già effettuato l’accesso con essa resta connesso — usa «Esci ovunque» se è andato perso.',+ 'It is your only way in, so it cannot be removed until there is another.': 'È il tuo unico modo per entrare, quindi non si può rimuovere finché non ce n’è un altro.',+ 'Last used {0}': 'Usata l’ultima volta il {0}',+ 'Make a new code': 'Crea un nuovo codice',+ 'Name, e.g. Work laptop': 'Nome, es. Portatile del lavoro',+ 'None yet — add one to sign in without your password.': 'Nessuna per ora — aggiungine una per accedere senza password.',+ 'Passkey added': 'Passkey aggiunta',+ 'Passkey removed': 'Passkey rimossa',+ 'Passkey {0}': 'Passkey {0}',+ 'Passkeys': 'Passkey',+ 'Remove passkey': 'Rimuovi passkey',+ 'Remove this passkey?': 'Rimuovere questa passkey?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Scansionalo con l’altro dispositivo, oppure apri openGym lì e inserisci il codice nella schermata di accesso. Funziona una volta, per {0} minuti.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Questo codice è sbagliato, già usato o scaduto — creane uno nuovo sull’altro dispositivo.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Questo browser non può confermare con la tua passkey. Fallo su un dispositivo che ne conserva una.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Questo browser non può creare passkey, quindi non può essere aggiunto con un codice. Apri il link in un browser che ci riesce.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Questo browser ha effettuato l’accesso come «{0}». Aggiungerlo a «{1}» fa uscire «{0}» da qui.',+ 'This code has expired.': 'Questo codice è scaduto.',+ 'This device already has a passkey for this profile.': 'Questo dispositivo ha già una passkey per questo profilo.',+ 'This passkey already belongs to a profile.': 'Questa passkey appartiene già a un profilo.',+ 'This profile already has as many passkeys as it can hold.': 'Questo profilo ha già tutte le passkey che può avere.',+ 'Use a code from your other device': 'Usa un codice dall’altro dispositivo',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Ricevi un codice con cui il tuo telefono o un altro computer può creare una passkey per questo profilo. Prima conferma che sei tu.',+ 'or with your password': 'oppure con la tua password',+ '{0} passkeys': '{0} passkey','Each profile keeps its own plan, workouts & body weight.': 'Ogni profilo ha il proprio piano, allenamenti e peso corporeo.','Account': 'Account','Sign out?': 'Uscire?',diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 45376dfe3..5fc726cd0 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': '재설정 코드가 틀렸거나 만료되었습니다 — 관리자에게 새 코드를 요청하세요.','This account has been disabled.': '이 계정은 비활성화되었습니다.','The server is busy — try again in a moment.': '서버가 바쁩니다 — 잠시 후 다시 시도하세요.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '패스키 1개',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': '일회용 코드로 휴대폰이나 다른 컴퓨터가 자체 패스키로 로그인할 수 있습니다.',+ 'Add a passkey': '패스키 추가',+ 'Add another device': '다른 기기 추가',+ 'Add this device': '이 기기 추가',+ 'Added {0}': '{0}에 추가됨',+ 'Code from your other device': '다른 기기의 코드',+ 'Confirm with a passkey': '패스키로 확인',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': '확인되었습니다. 이제 새 패스키를 만드세요 — 브라우저가 어디에 보관할지 묻습니다.',+ 'Copy link': '링크 복사',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': '이 기기에서 "{0}" 프로필용 패스키를 만드세요. 앞으로 여기서는 이 패스키로 로그인합니다.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': '각 패스키는 그것을 보관하는 기기나 비밀번호 관리자에서 이 프로필에 로그인합니다. 이름을 바꾸거나 제거하려면 하나를 탭하세요.',+ 'Enter the code from your other device.': '다른 기기의 코드를 입력하세요.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': '다른 기기의 설정 → 다른 기기 추가에 표시되는 코드를 입력하세요. 그러면 이 기기에도 자체 패스키가 생깁니다.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': '이 기기, 보안 키, 비밀번호 관리자 또는 브라우저 자체 QR 코드를 통한 휴대폰용입니다. 먼저 본인인지 확인하세요.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': '더 이상 이 프로필에 로그인할 수 없습니다. 이 패스키로 이미 로그인된 기기는 로그인 상태로 남습니다 — 분실했다면 "모든 기기에서 로그아웃"을 사용하세요.',+ 'It is your only way in, so it cannot be removed until there is another.': '유일한 로그인 수단이므로 다른 수단이 생길 때까지 제거할 수 없습니다.',+ 'Last used {0}': '마지막 사용 {0}',+ 'Make a new code': '새 코드 만들기',+ 'Name, e.g. Work laptop': '이름, 예: 업무용 노트북',+ 'None yet — add one to sign in without your password.': '아직 없음 — 비밀번호 없이 로그인하려면 하나 추가하세요.',+ 'Passkey added': '패스키 추가됨',+ 'Passkey removed': '패스키 제거됨',+ 'Passkey {0}': '패스키 {0}',+ 'Passkeys': '패스키',+ 'Remove passkey': '패스키 제거',+ 'Remove this passkey?': '이 패스키를 제거할까요?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': '다른 기기로 스캔하거나, 그 기기에서 openGym을 열고 로그인 화면에 코드를 입력하세요. 한 번만, {0}분 동안 사용할 수 있습니다.',+ 'That code is wrong, used or expired — make a new one on your other device.': '코드가 틀렸거나 이미 사용되었거나 만료되었습니다 — 다른 기기에서 새 코드를 만드세요.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': '이 브라우저에서는 패스키로 확인할 수 없습니다. 패스키가 있는 기기에서 진행하세요.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': '이 브라우저는 패스키를 만들 수 없어 코드로 추가할 수 없습니다. 패스키를 만들 수 있는 브라우저에서 링크를 여세요.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': '이 브라우저는 "{0}"(으)로 로그인되어 있습니다. "{1}"에 추가하면 여기서 "{0}"은(는) 로그아웃됩니다.',+ 'This code has expired.': '코드가 만료되었습니다.',+ 'This device already has a passkey for this profile.': '이 기기에는 이미 이 프로필의 패스키가 있습니다.',+ 'This passkey already belongs to a profile.': '이 패스키는 이미 프로필에 등록되어 있습니다.',+ 'This profile already has as many passkeys as it can hold.': '이 프로필에는 이미 최대 개수의 패스키가 있습니다.',+ 'Use a code from your other device': '다른 기기의 코드 사용',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': '휴대폰이나 다른 컴퓨터가 이 프로필용 패스키를 만들 수 있는 코드를 받습니다. 먼저 본인인지 확인하세요.',+ 'or with your password': '또는 비밀번호로',+ '{0} passkeys': '패스키 {0}개','Each profile keeps its own plan, workouts & body weight.': '프로필마다 자신의 계획, 운동, 체중을 보관합니다.','Account': '계정','Sign out?': '로그아웃할까요?',diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 2df47da45..54e251e01 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Ten kod resetu jest błędny lub wygasł — poproś administratora o nowy.','This account has been disabled.': 'To konto zostało wyłączone.','The server is busy — try again in a moment.': 'Serwer jest zajęty — spróbuj ponownie za chwilę.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 passkey',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Kod jednorazowy pozwala twojemu telefonowi lub innemu komputerowi logować się własnym passkey.',+ 'Add a passkey': 'Dodaj passkey',+ 'Add another device': 'Dodaj kolejne urządzenie',+ 'Add this device': 'Dodaj to urządzenie',+ 'Added {0}': 'Dodano {0}',+ 'Code from your other device': 'Kod z drugiego urządzenia',+ 'Confirm with a passkey': 'Potwierdź passkey',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Potwierdzono. Teraz utwórz nowy passkey — przeglądarka zapyta, gdzie go zapisać.',+ 'Copy link': 'Kopiuj link',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Utwórz na tym urządzeniu passkey dla profilu „{0}”. Od teraz będziesz się nim tu logować.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Każdy z nich loguje do tego profilu z urządzenia lub menedżera haseł, w którym jest zapisany. Dotknij jednego, aby zmienić jego nazwę albo go usunąć.',+ 'Enter the code from your other device.': 'Wpisz kod z drugiego urządzenia.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Wpisz kod, który twoje drugie urządzenie pokazuje w Ustawienia → Dodaj kolejne urządzenie. To urządzenie dostanie wtedy własny passkey.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Dla tego urządzenia, klucza bezpieczeństwa, menedżera haseł albo twojego telefonu przez kod QR samej przeglądarki. Najpierw potwierdź, że to ty.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Nie będzie już można się nim zalogować do tego profilu. Urządzenie, które jest nim już zalogowane, pozostanie zalogowane — użyj „Wyloguj wszędzie”, jeśli zostało zgubione.',+ 'It is your only way in, so it cannot be removed until there is another.': 'To twój jedyny sposób wejścia, więc nie można go usunąć, dopóki nie będzie innego.',+ 'Last used {0}': 'Ostatnio użyty {0}',+ 'Make a new code': 'Utwórz nowy kod',+ 'Name, e.g. Work laptop': 'Nazwa, np. Laptop służbowy',+ 'None yet — add one to sign in without your password.': 'Jeszcze żadnego — dodaj passkey, aby logować się bez hasła.',+ 'Passkey added': 'Dodano passkey',+ 'Passkey removed': 'Usunięto passkey',+ 'Passkey {0}': 'Passkey {0}',+ 'Passkeys': 'Passkeys',+ 'Remove passkey': 'Usuń passkey',+ 'Remove this passkey?': 'Usunąć ten passkey?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Zeskanuj to drugim urządzeniem albo otwórz tam openGym i wpisz kod na ekranie logowania. Działa raz, przez {0} minut.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Ten kod jest błędny, już użyty albo wygasł — utwórz nowy na drugim urządzeniu.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Ta przeglądarka nie może potwierdzić twoim passkey. Zrób to na urządzeniu, na którym go masz.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Ta przeglądarka nie potrafi tworzyć passkey, więc nie można jej dodać kodem. Otwórz link w przeglądarce, która to potrafi.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Ta przeglądarka jest zalogowana jako „{0}”. Dodanie jej do „{1}” wyloguje tu „{0}”.',+ 'This code has expired.': 'Ten kod wygasł.',+ 'This device already has a passkey for this profile.': 'To urządzenie ma już passkey dla tego profilu.',+ 'This passkey already belongs to a profile.': 'Ten passkey należy już do jakiegoś profilu.',+ 'This profile already has as many passkeys as it can hold.': 'Ten profil ma już tyle passkey, ile może mieć.',+ 'Use a code from your other device': 'Użyj kodu z drugiego urządzenia',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Dostaniesz kod, dzięki któremu twój telefon lub inny komputer utworzy passkey dla tego profilu. Najpierw potwierdź, że to ty.',+ 'or with your password': 'albo swoim hasłem',+ '{0} passkeys': 'Passkeys: {0}','Each profile keeps its own plan, workouts & body weight.': 'Każdy profil ma własny plan, treningi i masę ciała.','Account': 'Konto','Sign out?': 'Wylogować?',diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex 20f3ff857..0bbaf3fd6 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -345,6 +345,47 @@ export const PT_BR_OVERRIDES = {'This password is the only way into your profile, so it cannot be removed.': 'Esta senha é a única forma de entrar no seu perfil, por isso não pode ser removida.','That reset code is wrong or has expired — ask your admin for a new one.': 'Esse código de redefinição está errado ou expirou — peça um novo ao seu administrador.','The server is busy — try again in a moment.': 'O servidor está ocupado — tente novamente daqui a pouco.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 chave de acesso',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Um código de uso único permite que seu celular ou outro computador entre com uma chave de acesso própria.',+ 'Add a passkey': 'Adicionar uma chave de acesso',+ 'Add another device': 'Adicionar outro dispositivo',+ 'Add this device': 'Adicionar este dispositivo',+ 'Added {0}': 'Adicionada em {0}',+ 'Code from your other device': 'Código do seu outro dispositivo',+ 'Confirm with a passkey': 'Confirmar com uma chave de acesso',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Confirmado. Agora crie a nova chave de acesso — seu navegador pergunta onde guardá-la.',+ 'Copy link': 'Copiar link',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Crie neste dispositivo uma chave de acesso para o perfil “{0}”. A partir de agora, você entra aqui com ela.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Cada uma entra neste perfil a partir do dispositivo ou do gerenciador de senhas que a guarda. Toque em uma para renomeá-la ou removê-la.',+ 'Enter the code from your other device.': 'Digite o código do seu outro dispositivo.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Digite o código que seu outro dispositivo mostra em Configurações → Adicionar outro dispositivo. Este dispositivo passa a ter uma chave de acesso própria.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Para este dispositivo, uma chave de segurança, um gerenciador de senhas ou seu celular pelo código QR do próprio navegador. Primeiro confirme que é você.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Ela não poderá mais entrar neste perfil. Um dispositivo que já entrou com ela continua conectado — use “Sair de todos os dispositivos” se ele foi perdido.',+ 'It is your only way in, so it cannot be removed until there is another.': 'É sua única forma de entrar, por isso não pode ser removida enquanto não houver outra.',+ 'Last used {0}': 'Usada pela última vez em {0}',+ 'Make a new code': 'Criar um novo código',+ 'Name, e.g. Work laptop': 'Nome, ex.: Notebook do trabalho',+ 'None yet — add one to sign in without your password.': 'Nenhuma ainda — adicione uma para entrar sem sua senha.',+ 'Passkey added': 'Chave de acesso adicionada',+ 'Passkey removed': 'Chave de acesso removida',+ 'Passkey {0}': 'Chave de acesso {0}',+ 'Passkeys': 'Chaves de acesso',+ 'Remove passkey': 'Remover chave de acesso',+ 'Remove this passkey?': 'Remover esta chave de acesso?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Escaneie isto com o outro dispositivo, ou abra o openGym nele e digite o código na tela de entrada. Funciona uma vez, por {0} minutos.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Esse código está errado, já foi usado ou expirou — crie um novo no seu outro dispositivo.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Este navegador não consegue confirmar com sua chave de acesso. Faça isso em um dispositivo que tenha uma.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Este navegador não consegue criar chaves de acesso, por isso não pode ser adicionado com um código. Abra o link em um navegador que consiga.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Este navegador está conectado como “{0}”. Adicioná-lo a “{1}” desconecta “{0}” aqui.',+ 'This code has expired.': 'Este código expirou.',+ 'This device already has a passkey for this profile.': 'Este dispositivo já tem uma chave de acesso para este perfil.',+ 'This passkey already belongs to a profile.': 'Esta chave de acesso já pertence a um perfil.',+ 'This profile already has as many passkeys as it can hold.': 'Este perfil já tem todas as chaves de acesso que pode ter.',+ 'Use a code from your other device': 'Usar um código do seu outro dispositivo',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Você recebe um código com o qual seu celular ou outro computador pode criar uma chave de acesso para este perfil. Primeiro confirme que é você.',+ 'or with your password': 'ou com sua senha',+ '{0} passkeys': '{0} chaves de acesso','Passkeys not supported in this browser.': 'Chaves de acesso não são compatíveis com este navegador.','Su': 'D','Mo': 'S',diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex d3f3da62a..423892b60 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Esse código de reposição está errado ou expirou — pede um novo ao teu administrador.','This account has been disabled.': 'Esta conta foi desativada.','The server is busy — try again in a moment.': 'O servidor está ocupado — tenta novamente daqui a pouco.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 passkey',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Um código de utilização única permite que o teu telemóvel ou outro computador inicie sessão com uma passkey própria.',+ 'Add a passkey': 'Adicionar uma passkey',+ 'Add another device': 'Adicionar outro dispositivo',+ 'Add this device': 'Adicionar este dispositivo',+ 'Added {0}': 'Adicionada a {0}',+ 'Code from your other device': 'Código do teu outro dispositivo',+ 'Confirm with a passkey': 'Confirmar com uma passkey',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Confirmado. Agora cria a nova passkey — o teu navegador pergunta onde a guardar.',+ 'Copy link': 'Copiar ligação',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Cria neste dispositivo uma passkey para o perfil «{0}». A partir de agora, é com ela que inicias sessão aqui.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Cada uma inicia sessão neste perfil a partir do dispositivo ou do gestor de palavras-passe que a guarda. Toca numa para lhe mudar o nome ou a remover.',+ 'Enter the code from your other device.': 'Introduz o código do teu outro dispositivo.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Introduz o código que o teu outro dispositivo mostra em Definições → Adicionar outro dispositivo. Este dispositivo fica então com uma passkey própria.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Para este dispositivo, uma chave de segurança, um gestor de palavras-passe ou o teu telemóvel através do código QR do próprio navegador. Primeiro confirma que és tu.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Deixa de poder iniciar sessão neste perfil. Um dispositivo que já tenha sessão iniciada com ela continua com sessão iniciada — usa «Terminar sessão em todos os dispositivos» se o perdeste.',+ 'It is your only way in, so it cannot be removed until there is another.': 'É a tua única forma de entrar, por isso não pode ser removida enquanto não houver outra.',+ 'Last used {0}': 'Usada pela última vez a {0}',+ 'Make a new code': 'Criar um novo código',+ 'Name, e.g. Work laptop': 'Nome, p. ex. Portátil do trabalho',+ 'None yet — add one to sign in without your password.': 'Ainda nenhuma — adiciona uma para iniciares sessão sem a tua palavra-passe.',+ 'Passkey added': 'Passkey adicionada',+ 'Passkey removed': 'Passkey removida',+ 'Passkey {0}': 'Passkey {0}',+ 'Passkeys': 'Passkeys',+ 'Remove passkey': 'Remover passkey',+ 'Remove this passkey?': 'Remover esta passkey?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Digitaliza isto com o outro dispositivo, ou abre lá o openGym e introduz o código no ecrã de início de sessão. Funciona uma vez, durante {0} minutos.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Esse código está errado, já foi usado ou expirou — cria um novo no teu outro dispositivo.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Este navegador não consegue confirmar com a tua passkey. Faz isto num dispositivo que tenha uma.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Este navegador não consegue criar passkeys, por isso não pode ser adicionado com um código. Abre a ligação num navegador que consiga.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Este navegador tem sessão iniciada como «{0}». Adicioná-lo a «{1}» termina aqui a sessão de «{0}».',+ 'This code has expired.': 'Este código expirou.',+ 'This device already has a passkey for this profile.': 'Este dispositivo já tem uma passkey para este perfil.',+ 'This passkey already belongs to a profile.': 'Esta passkey já pertence a um perfil.',+ 'This profile already has as many passkeys as it can hold.': 'Este perfil já tem todas as passkeys que pode ter.',+ 'Use a code from your other device': 'Usar um código do teu outro dispositivo',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Recebes um código com o qual o teu telemóvel ou outro computador pode criar uma passkey para este perfil. Primeiro confirma que és tu.',+ 'or with your password': 'ou com a tua palavra-passe',+ '{0} passkeys': '{0} passkeys','Each profile keeps its own plan, workouts & body weight.': 'Cada perfil guarda o seu plano, treinos e peso corporal.','Account': 'Conta','Sign out?': 'Terminar sessão?',diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 3154e3645..d7761112b 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Этот код сброса неверный или истёк — попроси у администратора новый.','This account has been disabled.': 'Эта учётная запись отключена.','The server is busy — try again in a moment.': 'Сервер занят — попробуй ещё раз чуть позже.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 ключ доступа',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Одноразовый код позволяет твоему телефону или другому компьютеру входить со своим ключом доступа.',+ 'Add a passkey': 'Добавить ключ доступа',+ 'Add another device': 'Добавить другое устройство',+ 'Add this device': 'Добавить это устройство',+ 'Added {0}': 'Добавлен {0}',+ 'Code from your other device': 'Код с другого устройства',+ 'Confirm with a passkey': 'Подтвердить ключом доступа',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Подтверждено. Теперь создай новый ключ доступа — браузер спросит, где его хранить.',+ 'Copy link': 'Копировать ссылку',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Создай на этом устройстве ключ доступа для профиля «{0}». Теперь здесь ты будешь входить с ним.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Каждый из них входит в этот профиль с устройства или из менеджера паролей, где он хранится. Нажми на ключ, чтобы переименовать или удалить его.',+ 'Enter the code from your other device.': 'Введи код с другого устройства.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Введи код, который другое устройство показывает в разделе Настройки → Добавить другое устройство. Тогда у этого устройства будет свой ключ доступа.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Для этого устройства, аппаратного ключа, менеджера паролей или телефона через QR-код самого браузера. Сначала подтверди, что это ты.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'С ним больше нельзя будет войти в этот профиль. Устройство, которое уже вошло с ним, останется в аккаунте — используй «Выйти на всех устройствах», если оно потеряно.',+ 'It is your only way in, so it cannot be removed until there is another.': 'Это твой единственный способ войти, поэтому его нельзя удалить, пока нет другого.',+ 'Last used {0}': 'Последнее использование: {0}',+ 'Make a new code': 'Создать новый код',+ 'Name, e.g. Work laptop': 'Название, например Рабочий ноутбук',+ 'None yet — add one to sign in without your password.': 'Пока нет — добавь ключ, чтобы входить без пароля.',+ 'Passkey added': 'Ключ доступа добавлен',+ 'Passkey removed': 'Ключ доступа удалён',+ 'Passkey {0}': 'Ключ доступа {0}',+ 'Passkeys': 'Ключи доступа',+ 'Remove passkey': 'Удалить ключ доступа',+ 'Remove this passkey?': 'Удалить этот ключ доступа?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Отсканируй это другим устройством или открой там openGym и введи код на экране входа. Код работает один раз в течение {0} минут.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Этот код неверный, уже использован или истёк — создай новый на другом устройстве.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Этот браузер не может подтвердить твоим ключом доступа. Сделай это на устройстве, где он хранится.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Этот браузер не умеет создавать ключи доступа, поэтому его нельзя добавить по коду. Открой ссылку в браузере, который это умеет.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'В этом браузере выполнен вход как «{0}». Если добавить его к «{1}», «{0}» здесь выйдет из аккаунта.',+ 'This code has expired.': 'Срок действия кода истёк.',+ 'This device already has a passkey for this profile.': 'На этом устройстве уже есть ключ доступа для этого профиля.',+ 'This passkey already belongs to a profile.': 'Этот ключ доступа уже принадлежит профилю.',+ 'This profile already has as many passkeys as it can hold.': 'У этого профиля уже максимальное число ключей доступа.',+ 'Use a code from your other device': 'Использовать код с другого устройства',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Ты получишь код, с которым твой телефон или другой компьютер сможет создать ключ доступа для этого профиля. Сначала подтверди, что это ты.',+ 'or with your password': 'или своим паролем',+ '{0} passkeys': 'Ключей доступа: {0}','Each profile keeps its own plan, workouts & body weight.': 'У каждого профиля свой план, тренировки и вес тела.','Account': 'Аккаунт','Sign out?': 'Выйти?',diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex b1fdb57bd..3551980d5 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -345,6 +345,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'รหัสรีเซ็ตนี้ไม่ถูกต้องหรือหมดอายุแล้ว — ขอรหัสใหม่จากผู้ดูแลระบบของคุณ','This account has been disabled.': 'บัญชีนี้ถูกปิดใช้งานแล้ว','The server is busy — try again in a moment.': 'เซิร์ฟเวอร์ไม่ว่าง — ลองใหม่อีกครั้งในอีกสักครู่',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 พาสคีย์',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'รหัสแบบใช้ครั้งเดียวช่วยให้โทรศัพท์หรือคอมพิวเตอร์เครื่องอื่นของคุณเข้าสู่ระบบด้วยพาสคีย์ของตัวเอง',+ 'Add a passkey': 'เพิ่มพาสคีย์',+ 'Add another device': 'เพิ่มอุปกรณ์อื่น',+ 'Add this device': 'เพิ่มอุปกรณ์นี้',+ 'Added {0}': 'เพิ่มเมื่อ {0}',+ 'Code from your other device': 'รหัสจากอุปกรณ์อีกเครื่องของคุณ',+ 'Confirm with a passkey': 'ยืนยันด้วยพาสคีย์',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'ยืนยันแล้ว ตอนนี้สร้างพาสคีย์ใหม่ — เบราว์เซอร์จะถามว่าจะเก็บไว้ที่ไหน',+ 'Copy link': 'คัดลอกลิงก์',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'สร้างพาสคีย์บนอุปกรณ์นี้สำหรับโปรไฟล์ “{0}” ต่อจากนี้คุณจะเข้าสู่ระบบที่นี่ด้วยพาสคีย์นี้',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'แต่ละรายการเข้าสู่ระบบโปรไฟล์นี้จากอุปกรณ์หรือตัวจัดการรหัสผ่านที่เก็บพาสคีย์นั้นไว้ แตะรายการเพื่อเปลี่ยนชื่อหรือลบ',+ 'Enter the code from your other device.': 'กรอกรหัสจากอุปกรณ์อีกเครื่องของคุณ',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'กรอกรหัสที่อุปกรณ์อีกเครื่องแสดงใน ตั้งค่า → เพิ่มอุปกรณ์อื่น แล้วอุปกรณ์นี้จะได้พาสคีย์ของตัวเอง',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'สำหรับอุปกรณ์นี้ กุญแจความปลอดภัย ตัวจัดการรหัสผ่าน หรือโทรศัพท์ของคุณผ่านคิวอาร์โค้ดของเบราว์เซอร์เอง ก่อนอื่นยืนยันว่าเป็นคุณ',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'พาสคีย์นี้จะเข้าสู่ระบบโปรไฟล์นี้ไม่ได้อีก อุปกรณ์ที่เข้าสู่ระบบด้วยพาสคีย์นี้อยู่แล้วจะยังอยู่ในระบบ — ใช้ “ออกจากระบบทุกอุปกรณ์” หากอุปกรณ์นั้นหาย',+ 'It is your only way in, so it cannot be removed until there is another.': 'นี่คือทางเดียวที่คุณเข้าสู่ระบบได้ จึงลบไม่ได้จนกว่าจะมีทางอื่น',+ 'Last used {0}': 'ใช้ล่าสุดเมื่อ {0}',+ 'Make a new code': 'สร้างรหัสใหม่',+ 'Name, e.g. Work laptop': 'ชื่อ เช่น แล็ปท็อปที่ทำงาน',+ 'None yet — add one to sign in without your password.': 'ยังไม่มี — เพิ่มพาสคีย์เพื่อเข้าสู่ระบบโดยไม่ต้องใช้รหัสผ่าน',+ 'Passkey added': 'เพิ่มพาสคีย์แล้ว',+ 'Passkey removed': 'ลบพาสคีย์แล้ว',+ 'Passkey {0}': 'พาสคีย์ {0}',+ 'Passkeys': 'พาสคีย์',+ 'Remove passkey': 'ลบพาสคีย์',+ 'Remove this passkey?': 'ลบพาสคีย์นี้ใช่ไหม?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'สแกนด้วยอุปกรณ์อีกเครื่อง หรือเปิด openGym บนเครื่องนั้นแล้วกรอกรหัสในหน้าจอเข้าสู่ระบบ ใช้ได้ครั้งเดียวภายใน {0} นาที',+ 'That code is wrong, used or expired — make a new one on your other device.': 'รหัสนี้ไม่ถูกต้อง ถูกใช้ไปแล้ว หรือหมดอายุ — สร้างรหัสใหม่บนอุปกรณ์อีกเครื่องของคุณ',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'เบราว์เซอร์นี้ยืนยันด้วยพาสคีย์ของคุณไม่ได้ ทำขั้นตอนนี้บนอุปกรณ์ที่เก็บพาสคีย์ไว้',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'เบราว์เซอร์นี้สร้างพาสคีย์ไม่ได้ จึงเพิ่มด้วยรหัสไม่ได้ เปิดลิงก์ในเบราว์เซอร์ที่สร้างพาสคีย์ได้',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'เบราว์เซอร์นี้เข้าสู่ระบบในชื่อ “{0}” อยู่ การเพิ่มเบราว์เซอร์นี้ให้ “{1}” จะทำให้ “{0}” ออกจากระบบที่นี่',+ 'This code has expired.': 'รหัสนี้หมดอายุแล้ว',+ 'This device already has a passkey for this profile.': 'อุปกรณ์นี้มีพาสคีย์สำหรับโปรไฟล์นี้อยู่แล้ว',+ 'This passkey already belongs to a profile.': 'พาสคีย์นี้เป็นของโปรไฟล์หนึ่งอยู่แล้ว',+ 'This profile already has as many passkeys as it can hold.': 'โปรไฟล์นี้มีพาสคีย์ครบจำนวนสูงสุดแล้ว',+ 'Use a code from your other device': 'ใช้รหัสจากอุปกรณ์อีกเครื่องของคุณ',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'คุณจะได้รับรหัสที่ให้โทรศัพท์หรือคอมพิวเตอร์เครื่องอื่นสร้างพาสคีย์สำหรับโปรไฟล์นี้ได้ ก่อนอื่นยืนยันว่าเป็นคุณ',+ 'or with your password': 'หรือด้วยรหัสผ่านของคุณ',+ '{0} passkeys': '{0} พาสคีย์','Each profile keeps its own plan, workouts & body weight.': 'แต่ละโปรไฟล์เก็บแผน, การออกกำลังกาย และน้ำหนักตัวของตัวเองแยกกัน',// --- settings ---'Account': 'บัญชี',diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex f9f030514..1a9584d5c 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Bu sıfırlama kodu yanlış ya da süresi dolmuş — yöneticinden yeni bir tane iste.','This account has been disabled.': 'Bu hesap devre dışı bırakıldı.','The server is busy — try again in a moment.': 'Sunucu meşgul — birazdan tekrar dene.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 geçiş anahtarı',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Tek kullanımlık bir kod, telefonunun veya başka bir bilgisayarın kendi geçiş anahtarıyla giriş yapmasını sağlar.',+ 'Add a passkey': 'Geçiş anahtarı ekle',+ 'Add another device': 'Başka bir cihaz ekle',+ 'Add this device': 'Bu cihazı ekle',+ 'Added {0}': 'Eklenme: {0}',+ 'Code from your other device': 'Diğer cihazındaki kod',+ 'Confirm with a passkey': 'Geçiş anahtarıyla onayla',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Onaylandı. Şimdi yeni geçiş anahtarını oluştur — tarayıcın onu nerede saklayacağını soracak.',+ 'Copy link': 'Bağlantıyı kopyala',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Bu cihazda “{0}” profili için bir geçiş anahtarı oluştur. Bundan sonra burada onunla giriş yaparsın.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Her biri, onu saklayan cihazdan veya şifre yöneticisinden bu profile giriş yapar. Yeniden adlandırmak ya da kaldırmak için birine dokun.',+ 'Enter the code from your other device.': 'Diğer cihazındaki kodu gir.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Diğer cihazının Ayarlar → Başka bir cihaz ekle bölümünde gösterdiği kodu gir. Böylece bu cihazın da kendi geçiş anahtarı olur.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Bu cihaz, bir güvenlik anahtarı, bir şifre yöneticisi ya da tarayıcının kendi QR koduyla telefonun için. Önce sen olduğunu onayla.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'Artık bu profile giriş yapamaz. Onunla zaten giriş yapmış bir cihaz oturumda kalır — kaybolduysa “Her yerden çıkış yap”ı kullan.',+ 'It is your only way in, so it cannot be removed until there is another.': 'Bu senin tek giriş yolun, bu yüzden başka bir yol olana kadar kaldırılamaz.',+ 'Last used {0}': 'Son kullanım: {0}',+ 'Make a new code': 'Yeni kod oluştur',+ 'Name, e.g. Work laptop': 'Ad, örn. İş dizüstüsü',+ 'None yet — add one to sign in without your password.': 'Henüz yok — şifren olmadan giriş yapmak için bir tane ekle.',+ 'Passkey added': 'Geçiş anahtarı eklendi',+ 'Passkey removed': 'Geçiş anahtarı kaldırıldı',+ 'Passkey {0}': 'Geçiş anahtarı {0}',+ 'Passkeys': 'Geçiş anahtarları',+ 'Remove passkey': 'Geçiş anahtarını kaldır',+ 'Remove this passkey?': 'Bu geçiş anahtarı kaldırılsın mı?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Bunu diğer cihazla tara ya da orada openGym’i açıp kodu giriş ekranına gir. Bir kez ve {0} dakika boyunca çalışır.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Bu kod yanlış, kullanılmış ya da süresi dolmuş — diğer cihazında yeni bir tane oluştur.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Bu tarayıcı geçiş anahtarınla onaylayamaz. Bunu, anahtarın kayıtlı olduğu bir cihazda yap.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Bu tarayıcı geçiş anahtarı oluşturamadığı için kodla eklenemez. Bağlantıyı bunu yapabilen bir tarayıcıda aç.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'Bu tarayıcıda “{0}” olarak oturum açık. Onu “{1}” profiline eklemek burada “{0}” oturumunu kapatır.',+ 'This code has expired.': 'Bu kodun süresi doldu.',+ 'This device already has a passkey for this profile.': 'Bu cihazda bu profil için zaten bir geçiş anahtarı var.',+ 'This passkey already belongs to a profile.': 'Bu geçiş anahtarı zaten bir profile ait.',+ 'This profile already has as many passkeys as it can hold.': 'Bu profilde zaten olabilecek en fazla sayıda geçiş anahtarı var.',+ 'Use a code from your other device': 'Diğer cihazındaki kodu kullan',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Telefonunun veya başka bir bilgisayarın bu profil için geçiş anahtarı oluşturmasını sağlayan bir kod alırsın. Önce sen olduğunu onayla.',+ 'or with your password': 'ya da şifrenle',+ '{0} passkeys': '{0} geçiş anahtarı','Each profile keeps its own plan, workouts & body weight.': 'Her profilin kendi planı, antrenmanları ve vücut ağırlığı vardır.','Account': 'Hesap','Sign out?': 'Çıkış yapılsın mı?',diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 630193a8b..0cdce0137 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -1477,4 +1477,45 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': 'Цей код скидання неправильний або прострочений — попроси в адміністратора новий.','This account has been disabled.': 'Цей акаунт вимкнено.','The server is busy — try again in a moment.': 'Сервер зайнятий — спробуй ще раз за мить.',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 ключ доступу',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': 'Одноразовий код дає змогу твоєму телефону чи іншому комп’ютеру входити з власним ключем доступу.',+ 'Add a passkey': 'Додати ключ доступу',+ 'Add another device': 'Додати інший пристрій',+ 'Add this device': 'Додати цей пристрій',+ 'Added {0}': 'Додано {0}',+ 'Code from your other device': 'Код з іншого пристрою',+ 'Confirm with a passkey': 'Підтвердити ключем доступу',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': 'Підтверджено. Тепер створи новий ключ доступу — браузер спитає, де його зберігати.',+ 'Copy link': 'Копіювати посилання',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': 'Створи на цьому пристрої ключ доступу для профілю «{0}». Відтепер тут ти входитимеш з ним.',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': 'Кожен із них входить у цей профіль із пристрою чи менеджера паролів, де він зберігається. Торкнися ключа, щоб перейменувати чи видалити його.',+ 'Enter the code from your other device.': 'Введи код з іншого пристрою.',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': 'Введи код, який інший пристрій показує в розділі Налаштування → Додати інший пристрій. Тоді цей пристрій отримає власний ключ доступу.',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': 'Для цього пристрою, апаратного ключа, менеджера паролів або телефона через QR-код самого браузера. Спершу підтверди, що це ти.',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': 'З ним більше не можна буде увійти в цей профіль. Пристрій, який уже увійшов з ним, залишиться в акаунті — скористайся «Вийти на всіх пристроях», якщо його загублено.',+ 'It is your only way in, so it cannot be removed until there is another.': 'Це твій єдиний спосіб увійти, тож його не можна видалити, доки немає іншого.',+ 'Last used {0}': 'Востаннє використано {0}',+ 'Make a new code': 'Створити новий код',+ 'Name, e.g. Work laptop': 'Назва, наприклад Робочий ноутбук',+ 'None yet — add one to sign in without your password.': 'Ще немає — додай ключ, щоб входити без пароля.',+ 'Passkey added': 'Ключ доступу додано',+ 'Passkey removed': 'Ключ доступу видалено',+ 'Passkey {0}': 'Ключ доступу {0}',+ 'Passkeys': 'Ключі доступу',+ 'Remove passkey': 'Видалити ключ доступу',+ 'Remove this passkey?': 'Видалити цей ключ доступу?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': 'Відскануй це іншим пристроєм або відкрий там openGym і введи код на екрані входу. Код працює один раз протягом {0} хвилин.',+ 'That code is wrong, used or expired — make a new one on your other device.': 'Цей код неправильний, уже використаний або прострочений — створи новий на іншому пристрої.',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': 'Цей браузер не може підтвердити твоїм ключем доступу. Зроби це на пристрої, де він зберігається.',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': 'Цей браузер не вміє створювати ключі доступу, тож його не можна додати за кодом. Відкрий посилання в браузері, який це вміє.',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': 'У цьому браузері виконано вхід як «{0}». Якщо додати його до «{1}», «{0}» тут вийде з акаунта.',+ 'This code has expired.': 'Термін дії коду минув.',+ 'This device already has a passkey for this profile.': 'На цьому пристрої вже є ключ доступу для цього профілю.',+ 'This passkey already belongs to a profile.': 'Цей ключ доступу вже належить профілю.',+ 'This profile already has as many passkeys as it can hold.': 'У цього профілю вже максимальна кількість ключів доступу.',+ 'Use a code from your other device': 'Використати код з іншого пристрою',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': 'Ти отримаєш код, з яким твій телефон чи інший комп’ютер зможе створити ключ доступу для цього профілю. Спершу підтверди, що це ти.',+ 'or with your password': 'або своїм паролем',+ '{0} passkeys': 'Ключів доступу: {0}',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex ed9024eac..088b7ed6b 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -339,6 +339,47 @@ export default {'That reset code is wrong or has expired — ask your admin for a new one.': '这个重置码错误或已过期 — 请向管理员要一个新的。','This account has been disabled.': '此账户已被停用。','The server is busy — try again in a moment.': '服务器繁忙 — 请稍后再试。',+ // --- more passkeys, one-time codes for another device (#95) ---+ '1 passkey': '1 个通行密钥',+ 'A one-time code lets your phone or another computer sign in with a passkey of its own.': '一次性代码可让你的手机或其他电脑用自己的通行密钥登录。',+ 'Add a passkey': '添加通行密钥',+ 'Add another device': '添加其他设备',+ 'Add this device': '添加此设备',+ 'Added {0}': '添加于 {0}',+ 'Code from your other device': '来自你另一台设备的代码',+ 'Confirm with a passkey': '用通行密钥确认',+ 'Confirmed. Now create the new passkey — your browser asks where to keep it.': '已确认。现在创建新的通行密钥——浏览器会问你要把它存在哪里。',+ 'Copy link': '复制链接',+ 'Create a passkey on this device for the profile “{0}”. It signs you in here from now on.': '在此设备上为档案“{0}”创建通行密钥。从现在起,你在这里用它登录。',+ 'Each one signs in to this profile from the device or password manager that keeps it. Tap one to rename or remove it.': '每个通行密钥都能从保存它的设备或密码管理器登录此档案。点按一个即可重命名或移除。',+ 'Enter the code from your other device.': '输入你另一台设备上的代码。',+ 'Enter the code your other device shows under Settings → Add another device. This device then gets a passkey of its own.': '输入你另一台设备在“设置 → 添加其他设备”中显示的代码。之后此设备会有自己的通行密钥。',+ 'For this device, a security key, a password manager, or your phone through the browser’s own QR code. First confirm that it is you.': '用于此设备、安全密钥、密码管理器,或通过浏览器自带的二维码使用你的手机。请先确认是你本人。',+ 'It can no longer sign in to this profile. A device already signed in with it stays signed in — use Sign out everywhere if it was lost.': '它将无法再登录此档案。已用它登录的设备会保持登录——如果设备丢失,请使用“在所有设备上退出登录”。',+ 'It is your only way in, so it cannot be removed until there is another.': '这是你唯一的登录方式,在有其他方式之前不能移除。',+ 'Last used {0}': '上次使用于 {0}',+ 'Make a new code': '生成新代码',+ 'Name, e.g. Work laptop': '名称,例如:工作笔记本',+ 'None yet — add one to sign in without your password.': '还没有——添加一个,就能不用密码登录。',+ 'Passkey added': '已添加通行密钥',+ 'Passkey removed': '已移除通行密钥',+ 'Passkey {0}': '通行密钥 {0}',+ 'Passkeys': '通行密钥',+ 'Remove passkey': '移除通行密钥',+ 'Remove this passkey?': '移除这个通行密钥?',+ 'Scan this with the other device, or open openGym there and enter the code on the sign-in screen. It works once, for {0} minutes.': '用另一台设备扫描,或在那台设备上打开 openGym,在登录界面输入代码。仅可使用一次,{0} 分钟内有效。',+ 'That code is wrong, used or expired — make a new one on your other device.': '代码错误、已被使用或已过期——请在你另一台设备上生成新的代码。',+ 'This browser cannot confirm with your passkey. Do this on a device that holds one.': '此浏览器无法用你的通行密钥确认。请在保存了通行密钥的设备上操作。',+ 'This browser cannot create passkeys, so it cannot be added with a code. Open the link in a browser that can.': '此浏览器无法创建通行密钥,因此不能通过代码添加。请在能创建通行密钥的浏览器中打开此链接。',+ 'This browser is signed in as “{0}”. Adding it to “{1}” signs “{0}” out here.': '此浏览器已以“{0}”登录。将它添加到“{1}”会让“{0}”在这里退出登录。',+ 'This code has expired.': '此代码已过期。',+ 'This device already has a passkey for this profile.': '此设备已有该档案的通行密钥。',+ 'This passkey already belongs to a profile.': '此通行密钥已属于某个档案。',+ 'This profile already has as many passkeys as it can hold.': '此档案的通行密钥数量已达上限。',+ 'Use a code from your other device': '使用另一台设备上的代码',+ 'You get a code that lets your phone or another computer create a passkey for this profile. First confirm that it is you.': '你会得到一个代码,你的手机或其他电脑可以用它为此档案创建通行密钥。请先确认是你本人。',+ 'or with your password': '或使用你的密码',+ '{0} passkeys': '{0} 个通行密钥','Each profile keeps its own plan, workouts & body weight.': '每个档案有自己的计划、训练和体重。','Account': '账号','Sign out?': '退出登录?',diff --git a/frontend/src/store/useStore.device-link.test.jsx b/frontend/src/store/useStore.device-link.test.jsxnew file mode 100644index 000000000..8a5c35417--- /dev/null+++ b/frontend/src/store/useStore.device-link.test.jsx@@ -0,0 +1,43 @@+// @vitest-environment happy-dom++/* A page opened from a device-link QR code (#95) carries the one-time code as ?link=. The web+ boot takes it off the address before anything else can see or keep it — a reload, a bookmark,+ a screenshot of the address bar — and holds it for the sheet that redeems it. */+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'++vi.mock('../lib/api.js', () => ({ api: vi.fn(), setRemoteAuth: vi.fn() }))+vi.mock('./useUI.js', () => ({ useUI: { getState: () => ({ toast: vi.fn() }) } }))++import { api } from '../lib/api.js'+import { useStore } from './useStore.js'++const bootSignedOut = async () => {+ api.mockImplementation(async path => {+ if (path === '/api/config') return { allow_guest: true }+ if (path === '/api/me') throw Object.assign(new Error('not signed in'), { status: 401 })+ throw new Error('unexpected ' + path)+ })+ await useStore.getState().boot()+}++beforeEach(() => { localStorage.clear(); api.mockReset(); useStore.setState({ user: null, ready: false, config: null, linkCode: null }) })+afterEach(() => { history.replaceState({}, '', '/'); useStore.setState({ user: null, ready: false, config: null, linkCode: null }) })++describe('boot with a device-link code', () => {+ it('takes ?link= off the address, keeps the rest of it, and holds the code for the redeem sheet', async () => {+ history.replaceState({}, '', '/gym/?link=K7WQ-2MZP-4HXA&utm=x#/home')+ await bootSignedOut()+ expect(useStore.getState().linkCode).toBe('K7WQ-2MZP-4HXA')+ expect(window.location.search).toBe('?utm=x')+ expect(window.location.pathname).toBe('/gym/')+ expect(window.location.hash).toBe('#/home')+ expect(useStore.getState().ready).toBe(true)+ })++ it('leaves the address and the store alone without one', async () => {+ history.replaceState({}, '', '/?utm=x')+ await bootSignedOut()+ expect(useStore.getState().linkCode).toBeNull()+ expect(window.location.search).toBe('?utm=x')+ })+})diff --git a/frontend/src/store/useStore.js b/frontend/src/store/useStore.jsindex a6096d32d..292e67dbc 100644--- a/frontend/src/store/useStore.js+++ b/frontend/src/store/useStore.js@@ -10,6 +10,7 @@ import { mergeStates, localExtras, stampRoutines } from '../lib/sync-merge.js'import { countChanges, syncFingerprint } from '../lib/sync-changes.js'import { saveWorkoutEdit } from '../lib/session-edit.js'import { appBase } from '../lib/app-base.js'+import { linkTokenFromSearch, stripLinkFromUrl } from '../lib/device-link.js'import { loadRemote, chooseLocal, forgetRemote, connect, normalizeServerUrl, renewToken } from '../lib/remote.js'import { loadCoachDevice, saveCoachDevice, coachDeviceSettings } from '../lib/coach-device.js'import { RTL_LANGS } from '../lib/i18n-core.js'@@ -684,6 +685,9 @@ export const useStore = create((set, get) => {always did, and a configured one is the only place any of it appears. */config: null,needsMobileOnboarding: false, // mobile build only — set true by boot() on a genuine first launch+ // A one-time device-link code this page was opened with (?link=, #95), until it is redeemed.+ // Never persisted: the code is good for minutes and belongs to this one visit.+ linkCode: null,// Mobile build only: how the Coach runs on this phone — { mode: 'off'|'server'|'byok',// provider, model, baseUrl } from lib/coach-device.js. Never the key, never a proposal.coachLocal: null,@@ -1099,6 +1103,11 @@ export const useStore = create((set, get) => {finishBoot()return}+ // Opened from a device-link QR code (#95): the code comes off the address at once — a reload,+ // a bookmark or a shared screenshot of the address bar must not carry it around — and waits+ // here for the sheet that redeems it (App.jsx, components/Passkeys.jsx).+ const linkCode = linkTokenFromSearch(window.location.search)+ if (linkCode) { stripLinkFromUrl(); set({ linkCode }) }// Guests never authenticate, so an instance that turned guest mode off has no request to// refuse — the only way the switch reaches someone already inside is here, on their next// boot. Ending the session needs a positive `allow_guest: false`; see lib/guest.js for whydiff --git a/frontend/src/views/Login.device-link.test.jsx b/frontend/src/views/Login.device-link.test.jsxnew file mode 100644index 000000000..8c202b4df--- /dev/null+++ b/frontend/src/views/Login.device-link.test.jsx@@ -0,0 +1,73 @@+// @vitest-environment happy-dom+import React, { act } from 'react'+import { createRoot } from 'react-dom/client'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import Login from './Login.jsx'++globalThis.IS_REACT_ACT_ENVIRONMENT = true++/* The sign-in screen's way in for a device whose person already has a profile elsewhere (#95):+ a code from the signed-in device gives this one a passkey of its own, instead of "Create new+ profile" making a second, empty one. Only where this browser can make a passkey. */+const mocks = vi.hoisted(() => {+ const state = { webauthn: true, config: null, sheets: [] }+ state.snapshot = () => ({+ config: state.config, S: {}, user: null, linkCode: null,+ setUser: vi.fn(), adoptProfile: vi.fn(), setGuest: vi.fn(), loadConfig: vi.fn(async () => state.config),+ pushState: vi.fn(), pullState: vi.fn(),+ })+ return state+})+vi.mock('../store/useStore.js', () => {+ const useStore = selector => selector ? selector(mocks.snapshot()) : mocks.snapshot()+ useStore.getState = mocks.snapshot+ return { useStore, hasData: () => false }+})+vi.mock('../store/useUI.js', () => {+ const snap = () => ({ toast: vi.fn(), openSheet: render => { mocks.sheets.push(render); return {} } })+ const useUI = selector => selector ? selector(snap()) : snap()+ useUI.getState = snap+ return { useUI }+})+vi.mock('../lib/api.js', () => ({+ webauthnOK: () => mocks.webauthn, passkeyLogin: vi.fn(), passkeyRegister: vi.fn(), BIO: 'your fingerprint',+ api: vi.fn(), passkeyAssertion: vi.fn(), passwordLogin: vi.fn(), passwordRegister: vi.fn(), passwordResetRedeem: vi.fn(),+ createPasskey: vi.fn(),+}))+vi.mock('../lib/demo.js', () => ({ DEMO: false, REPO: 'https://example.invalid' }))+vi.mock('../sheets.jsx', () => ({ askAddDeviceData: vi.fn(), confirmSheet: vi.fn() }))++const mounted = []+function mount(el) {+ const host = document.createElement('div')+ document.body.appendChild(host)+ const root = createRoot(host)+ mounted.push({ root, host })+ act(() => root.render(el))+ return host+}+const buttons = host => [...host.querySelectorAll('button')].map(b => b.textContent)+const button = (host, text) => [...host.querySelectorAll('button')].find(b => b.textContent === text)++beforeEach(() => { mocks.webauthn = true; mocks.config = null; mocks.sheets.length = 0 })+afterEach(() => { act(() => { mounted.splice(0).forEach(({ root, host }) => { root.unmount(); host.remove() }) }) })++describe('Login: a code from another device', () => {+ it('sits under the ways in where passkeys work, and opens the sheet that redeems a code', () => {+ mocks.config = { allow_guest: true }+ const page = mount(<Login />)+ const all = buttons(page)+ expect(all.indexOf('Use a code from your other device')).toBe(all.indexOf('Create new profile') + 1)+ act(() => button(page, 'Use a code from your other device').click())+ const sheet = mount(mocks.sheets[0](() => {}))+ expect(sheet.querySelector('h3').textContent).toBe('Add this device')+ expect(sheet.querySelector('input[placeholder="Code from your other device"]')).toBeTruthy()+ })++ it('is not offered in a browser that cannot make a passkey, with or without passwords', () => {+ mocks.webauthn = false+ expect(buttons(mount(<Login />))).not.toContain('Use a code from your other device')+ mocks.config = { password_login: true }+ expect(buttons(mount(<Login />))).not.toContain('Use a code from your other device')+ })+})diff --git a/frontend/src/views/Login.jsx b/frontend/src/views/Login.jsxindex 5545a9257..39eaa5c0f 100644--- a/frontend/src/views/Login.jsx+++ b/frontend/src/views/Login.jsx@@ -10,6 +10,7 @@ import Icon from '../components/Icon.jsx'import { Button, Segmented } from '../components/ui.jsx'import { askAddDeviceData } from '../sheets.jsx'import { passwordOn, PasswordRegisterForm, openPasswordSignIn } from '../components/PasswordAuth.jsx'+import { openDeviceLinkRedeem } from '../components/Passkeys.jsx'function RegisterSheet({ close }) {const { setUser, pushState, pullState, loadConfig } = useStore()@@ -104,7 +105,11 @@ export default function Login() {<div style={{ height: 10 }} />{pwOn && <><Button icon="key" onClick={() => openPasswordSignIn()}>{t('Sign in with password')}</Button><div style={{ height: 10 }} /></>}<Button icon="sparkles" onClick={register}>{t('Create new profile')}</Button>- {canGuest && <div style={{ height: 10 }} />}+ {/* Already signed in on another device: a code from there gives this one a passkey of+ its own (#95), instead of a new, empty profile. */}+ <div style={{ height: 10 }} />+ <Button variant="ghost" className="dim" icon="qr" onClick={openDeviceLinkRedeem}>{t('Use a code from your other device')}</Button>+ {canGuest && <div style={{ height: 4 }} />}</> : pwOn ? <>{/* Plain http on a LAN address, or a browser without passkey support: the password isthe way in, and the only way to create a profile from here. */}diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex 5617a816e..5a69b697f 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -21,6 +21,7 @@ import { starterPlanSheet, confirmSheet, importFromApp, importFromHevy, equipmenimport Icon from '../components/Icon.jsx'import { ServerSyncSection, KeptChangesRows, leaveServer, connectServer, passkeySignIn } from '../components/ServerSync.jsx'import { passwordOn, PasswordRow, openPasswordSignIn, openPasswordRegister } from '../components/PasswordAuth.jsx'+import { usePasskeys, PasskeysRow, DeviceLinkRow } from '../components/Passkeys.jsx'import { Section, Row, SelectRow, Switch, Segmented, Button, TextField } from '../components/ui.jsx'export default function Settings() {@@ -30,6 +31,11 @@ export default function Settings() {const coachLocal = useStore(s => s.coachLocal)// Name-and-password sign-in, where the instance offers it (#118).const pwOn = passwordOn(useStore(s => s.config))+ // This profile's passkeys and the code for another device (#95). A change to them is read back+ // here and by the password row, whose "Remove" depends on there being a passkey.+ const passkeys = usePasskeys(!!user && !MOBILE && !DEMO)+ const [credsV, setCredsV] = useState(0)+ const credsChanged = () => { passkeys.load(); setCredsV(v => v + 1) }const { update, replaceState, setUser, pullState, pushState, resetDemo } = useStore()const toast = useUI(s => s.toast)const fileRef = useRef(null)@@ -230,9 +236,11 @@ export default function Settings() {onClick={() => window.open(REPO, '_blank', 'noopener')} /></> : user ? <>{user.admin && <Row icon="wrench" iconTint="var(--indigo)" title={t('Admin dashboard')} accessory="chevron" onClick={() => nav('/admin')} />}+ <PasskeysRow state={passkeys.st} changed={credsChanged} />+ <DeviceLinkRow state={passkeys.st} /><Row icon="link" iconTint="var(--blue)" title={t('Pair the mobile app')} subtitle={t('Connect the openGym app on your phone to this account.')} accessory="chevron"onClick={() => useUI.getState().openSheet(close => <PairSheet close={close} />)} />- {pwOn && <PasswordRow />}+ {pwOn && <PasswordRow version={credsV} />}<Row icon="signOut" iconTint="var(--red)" title={t('Sign out')} danger onClick={signOutHere} /><Row icon="shield" iconTint="var(--red)" title={t('Sign out everywhere')} subtitle={t('Ends this profile’s sessions on all your devices.')} danger onClick={signOutEverywhere} /><AccountIdRow id={user.id} />diff --git a/frontend/src/views/Settings.passkeys.test.jsx b/frontend/src/views/Settings.passkeys.test.jsxnew file mode 100644index 000000000..442f4c3ea--- /dev/null+++ b/frontend/src/views/Settings.passkeys.test.jsx@@ -0,0 +1,134 @@+// @vitest-environment happy-dom+import React, { act } from 'react'+import { createRoot } from 'react-dom/client'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import Settings from './Settings.jsx'++globalThis.IS_REACT_ACT_ENVIRONMENT = true++/* Settings → Account with more than one passkey (#95): the Passkeys row and the code for another+ device in a signed-in browser, nothing of it for a guest or against a server that has no such+ list, and the password row asking again once the passkeys changed — whether a password may be+ removed depends on them. */+const mocks = vi.hoisted(() => {+ // `kept` is one array for good: KeptChangesRows re-asks whenever the function changes, and a+ // fresh [] per answer would re-render it forever.+ const state = { S: null, user: null, sync: null, config: null, webauthn: true, sheets: [], kept: [] }+ state.passkeyLogin = vi.fn(async () => ({ id: 'u1', name: 'andi' }))+ state.list = { passkeys: [{ id: 'k1', name: 'Laptop', created: null, lastUsed: null, transports: [] }, { id: 'k2', name: null, created: null, lastUsed: null, transports: [] }], password: true, lastWayIn: false }+ state.api = vi.fn(async path => path === '/api/account/password' ? { set: true, setAt: null, passkeys: 2, name: 'andi', nameTaken: false }+ : path === '/api/account/passkeys' || path === '/api/account/passkeys/rename' ? state.list : {})+ state.snapshot = () => ({+ S: state.S, user: state.user, sync: state.sync, config: state.config, coachLocal: null,+ update: vi.fn(), replaceState: vi.fn(), setUser: vi.fn(), pullState: vi.fn(), pushState: vi.fn(), resetDemo: vi.fn(),+ syncNow: vi.fn(), unsyncedChanges: () => ({ owed: false, count: 0 }), keptChanges: async () => state.kept,+ disconnectServer: vi.fn(), signOut: vi.fn(), signOutAll: vi.fn(), adoptProfile: vi.fn(),+ })+ return state+})+vi.mock('../store/useStore.js', () => {+ const useStore = selector => selector ? selector(mocks.snapshot()) : mocks.snapshot()+ useStore.getState = mocks.snapshot+ return { useStore, DEF: { reminder: { time: '17:30' } }, hasData: () => false }+})+vi.mock('../store/useUI.js', () => {+ const snap = () => ({ toast: vi.fn(), openSheet: (render, opts) => { mocks.sheets.push({ render, opts }); return {} } })+ const useUI = selector => selector ? selector(snap()) : snap()+ useUI.getState = snap+ return { useUI }+})+vi.mock('react-router-dom', () => ({ useNavigate: () => () => {} }))+vi.mock('../lib/api.js', () => ({+ api: (...a) => mocks.api(...a), webauthnOK: () => mocks.webauthn, passkeyLogin: (...a) => mocks.passkeyLogin(...a), passkeyRegister: vi.fn(), IS_ANDROID: false,+ passkeyAssertion: vi.fn(), passwordLogin: vi.fn(), passwordRegister: vi.fn(), passwordResetRedeem: vi.fn(), createPasskey: vi.fn(),+}))+vi.mock('../lib/push.js', () => ({ pushSupported: () => false, enablePush: vi.fn(), disablePush: vi.fn(), sendTestPush: vi.fn() }))+vi.mock('../lib/wakelock.js', () => ({ wakeLockSupported: () => false }))+vi.mock('../lib/mobile.js', () => ({ MOBILE: false, isAndroid: () => Promise.resolve(false), shareExport: vi.fn(), syncReminder: vi.fn() }))+vi.mock('./MobileOnboarding.jsx', () => ({ ConnectSheet: () => null }))+vi.mock('../sheets.jsx', () => ({+ starterPlanSheet: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),+ importFromHevy: vi.fn(), equipmentProfileSheet: vi.fn(), menuSheet: vi.fn(), askAddDeviceData: vi.fn(),+}))++globalThis.__APP_VERSION__ ??= 'test'++const mounted = []+function mount(el) {+ const host = document.createElement('div')+ document.body.appendChild(host)+ const root = createRoot(host)+ mounted.push({ root, host })+ act(() => root.render(el))+ return host+}+const settle = () => act(() => new Promise(r => setTimeout(r, 0)))+const section = (page, title) => [...page.querySelectorAll('.sect')].find(s => s.querySelector('.sect-t')?.textContent === title)+const titles = el => [...el.querySelectorAll('.lrow-t')].map(t => t.textContent)+const rowByTitle = (el, title) => [...el.querySelectorAll('.lrow')].find(r => r.querySelector('.lrow-t')?.textContent === title)++beforeEach(() => {+ mocks.S = { unit: 'kg', restSec: 90, restPauseSec: 15, sound: false, effort: 'none', gifSize: 'full', workouts: [], routines: [], exWeights: {} }+ mocks.user = { id: 'u1', name: 'andi' }+ mocks.sync = { status: 'ok', offline: false, pending: false, auth: false, lastError: null, lastSynced: Date.now(), server: null }+ mocks.config = { password_login: true }+ mocks.webauthn = true+ mocks.sheets.length = 0+ mocks.passkeyLogin.mockClear()+ mocks.api.mockClear()+})+afterEach(() => { act(() => { mounted.splice(0).forEach(({ root, host }) => { root.unmount(); host.remove() }) }) })++const asked = path => mocks.api.mock.calls.filter(([p]) => p === path).length++describe('Settings: passkeys and another device', () => {+ it('a signed-in browser lists its passkeys and offers a code for another device, in Account', async () => {+ const page = mount(<Settings />)+ await settle()+ const account = section(page, 'Account')+ expect(titles(account)).toEqual(expect.arrayContaining(['Passkeys', 'Add another device']))+ expect(rowByTitle(account, 'Passkeys').textContent).toContain('2 passkeys')+ // Above pairing and the password, which are about other ways in.+ const order = titles(account)+ expect(order.indexOf('Passkeys')).toBeLessThan(order.indexOf('Pair the mobile app'))+ expect(order.indexOf('Add another device')).toBeLessThan(order.indexOf('Password'))+ })++ it('a guest gets neither, and nothing is asked', async () => {+ mocks.user = null+ const page = mount(<Settings />)+ await settle()+ expect(titles(page)).not.toContain('Passkeys')+ expect(titles(page)).not.toContain('Add another device')+ expect(asked('/api/account/passkeys')).toBe(0)+ })++ it('a server without the list shows neither row', async () => {+ const list = mocks.list+ mocks.list = {}+ try {+ const page = mount(<Settings />)+ await settle()+ expect(titles(page)).not.toContain('Passkeys')+ expect(titles(page)).not.toContain('Add another device')+ expect(titles(section(page, 'Account'))).toContain('Password')+ } finally { mocks.list = list }+ })++ it('a change to the passkeys reads the list and the password row again', async () => {+ const page = mount(<Settings />)+ await settle()+ expect(asked('/api/account/passkeys')).toBe(1)+ expect(asked('/api/account/password')).toBe(1)+ act(() => rowByTitle(section(page, 'Account'), 'Passkeys').click())+ const list = mount(mocks.sheets.at(-1).render(() => {}))+ await settle()+ act(() => rowByTitle(list, 'Laptop').click())+ const edit = mount(mocks.sheets.at(-1).render(() => {}))+ await act(async () => { edit.querySelector('form').dispatchEvent(new Event('submit', { bubbles: true, cancelable: true })) })+ await settle()+ expect(asked('/api/account/passkeys/rename')).toBe(1)+ expect(asked('/api/account/passkeys')).toBe(3) // Settings, the sheet, and Settings again+ expect(asked('/api/account/password')).toBe(2)+ })+})