Skip to content

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.

Sign-in: "Lost access?" says how to get back in (#584)

Duarte Santosa2c723940440
diff --git a/frontend/src/components/LostAccess.jsx b/frontend/src/components/LostAccess.jsx
new file mode 100644
index 000000000..ccb22ba8e
--- /dev/null
+++ b/frontend/src/components/LostAccess.jsx
@@ -0,0 +1,38 @@
+// "Lost access?" on the sign-in screen (#584): what to do when no device signs you in any more.
+// In order of how often each one is the answer: a synced passkey, another device that is still
+// signed in, a recovery code from the server's admin, and for whoever runs the server, the
+// server's own command. "I have a code" opens the same redemption a device link has
+// (Passkeys.jsx): a recovery code is redeemed exactly like one. The phone app cannot make a
+// passkey for the server, so there the code goes into a browser first and the app is paired again.
+import { useUI } from '../store/useUI.js'
+import { t } from '../lib/i18n.js'
+import { MOBILE } from '../lib/mobile.js'
+import { openDeviceLinkRedeem } from './Passkeys.jsx'
+import Icon from './Icon.jsx'
+import { Button } from './ui.jsx'
+
+const STEPS = () => [
+ ['fingerprint', t('Your passkey may be synced'), t('Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.')],
+ ['qr', t('Another device still signed in?'), t('On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.')],
+ ['person', t('Ask your admin'), t('Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.')],
+ ['wrench', t('Running the server yourself?'), t('Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"')],
+]
+
+export function LostAccessSheet({ close }) {
+ return <>
+ <h3>{t('Lost access?')}</h3>
+ <div className="muted small" style={{ marginBottom: 14, lineHeight: 1.5 }}>{t('No panic: your training is safe on the server. One of these gets you back in.')}</div>
+ <div style={{ display: 'grid', gap: 14, marginBottom: 18 }}>
+ {STEPS().map(([icon, title, body]) => <div key={title} className="row" style={{ gap: 12, alignItems: 'flex-start' }}>
+ <span style={{ color: 'var(--acc)', fontSize: 20, marginTop: 1 }}><Icon name={icon} /></span>
+ <div><div style={{ fontWeight: 600, marginBottom: 2 }}>{title}</div><div className="small muted" style={{ lineHeight: 1.45, overflowWrap: 'anywhere' }}>{body}</div></div>
+ </div>)}
+ </div>
+ {MOBILE
+ ? <div className="small dim" style={{ marginBottom: 14, lineHeight: 1.45 }}>{t('In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.')}</div>
+ : <><Button variant="primary" icon="qr" onClick={() => { close(); openDeviceLinkRedeem() }}>{t('I have a code')}</Button><div style={{ height: 8 }} /></>}
+ <Button variant="ghost" className="dim" onClick={close}>{t('Done')}</Button>
+ </>
+}
+
+export const openLostAccess = () => useUI.getState().openSheet(close => <LostAccessSheet close={close} />)
diff --git a/frontend/src/components/Passkeys.jsx b/frontend/src/components/Passkeys.jsx
index 8f40156da..3f65b2e69 100644
--- a/frontend/src/components/Passkeys.jsx
+++ b/frontend/src/components/Passkeys.jsx
@@ -329,7 +329,8 @@ export function DeviceLinkRedeemSheet({ close }) {
<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.name)
- : t('Enter the code your other device shows under Settings → Account → Add another device. This device then gets a passkey of its own.')}</div>
+ : t('Enter the code your other device shows under Settings → Account → Add another device. This device then gets a passkey of its own.')}
+ {!joining && <div style={{ marginTop: 6 }}>{t('A recovery code from your admin goes here too.')}</div>}</div>
{elsewhere && <div className="card small" style={{ textAlign: 'start', marginBottom: 14 }}>
{user && <div style={{ marginBottom: 8 }}>{user.name === joining.name
? t('This code is for a different profile that is also called “{0}”, not the one this browser is signed in as. Adding it there signs yours out here.', joining.name)
diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.js
index 40584a8d8..eaa38a500 100644
--- a/frontend/src/lib/pt-br-locale.test.js
+++ b/frontend/src/lib/pt-br-locale.test.js
@@ -41,7 +41,7 @@ describe('Brazilian Portuguese locale', () => {
// has to be taught is a number nobody reads. What the numbers stood for is asserted above.
// If the hash fails, review the changed keys and wording before accepting a new one. From
// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list
- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('e1eac562c2087de715552b4d092f9642c39f9c8e334c16000a2a78075fd83745')
+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('249b44d5c05290c24833aeb5fd2a49c1688ae6be8cc1d0d178edeb7aee7024e9')
})
// pt-PT labelled Unpair 'Desfazer': Undo, in Portuguese (it is pt-BR's Undo), on the button that
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.js
index 2e6223da0..b41eab50e 100644
--- a/frontend/src/locales/ar.js
+++ b/frontend/src/locales/ar.js
@@ -2430,4 +2430,17 @@ export default {
'Workout running': 'تمرين جارٍ',
'Set {0} of {1}': 'المجموعة {0} من {1}',
'All sets done': 'اكتملت كل المجموعات',
+ 'Lost access?': 'فقدت الوصول؟',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'لا داعي للقلق: تمارينك محفوظة على الخادم. إحدى هذه الطرق تعيدك.',
+ 'Your passkey may be synced': 'ربما يكون مفتاح المرور متزامنًا',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'مفاتيح المرور المحفوظة في سلسلة مفاتيح iCloud أو مدير كلمات مرور Google أو أي مدير لكلمات المرور موجودة على أجهزتك الأخرى أيضًا. جرّب «تسجيل الدخول بمفتاح المرور» هناك.',
+ 'Another device still signed in?': 'هل ما زال جهاز آخر مسجّل الدخول؟',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'افتح عليه الإعدادات ← الحساب ← إضافة جهاز آخر، ثم أدخل الرمز هنا عبر «لديّ رمز».',
+ 'Ask your admin': 'اسأل المسؤول',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'يمكن لمن يدير خادم openGym الخاص بك إنشاء رمز استرداد لك من لوحة الإدارة. أدخله عبر «لديّ رمز» وسيحصل هذا الجهاز على مفتاح مرور جديد.',
+ 'Running the server yourself?': 'هل تشغّل الخادم بنفسك؟',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'احصل على الخادم على رمز استرداد لأي ملف، حتى ملف المالك: docker compose exec api node recover.js "اسمك"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'في هذا التطبيق: أدخل الرمز في موقع openGym الخاص بك في متصفح، ثم أعد إقران التطبيق من الإعدادات ← الحساب هناك.',
+ 'I have a code': 'لديّ رمز',
+ 'A recovery code from your admin goes here too.': 'رمز الاسترداد من المسؤول يُدخل هنا أيضًا.',
}
diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.js
index d5c52a1d6..97ca2246e 100644
--- a/frontend/src/locales/bn.js
+++ b/frontend/src/locales/bn.js
@@ -2454,4 +2454,17 @@ export default {
'Workout running': 'ওয়ার্কআউট চলছে',
'Set {0} of {1}': 'সেট {0} / {1}',
'All sets done': 'সব সেট শেষ',
+ 'Lost access?': 'অ্যাক্সেস হারিয়েছেন?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'চিন্তা নেই: আপনার ট্রেনিং সার্ভারে নিরাপদে আছে। এগুলোর একটি দিয়ে আবার ঢুকতে পারবেন।',
+ 'Your passkey may be synced': 'আপনার পাসকি হয়তো সিঙ্ক করা আছে',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'iCloud Keychain, Google Password Manager বা কোনো পাসওয়ার্ড ম্যানেজারে রাখা পাসকি আপনার অন্য ডিভাইসেও থাকে। সেখানে “পাসকি দিয়ে সাইন ইন করুন” চেষ্টা করুন।',
+ 'Another device still signed in?': 'অন্য কোনো ডিভাইসে এখনো সাইন ইন করা আছে?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'সেখানে সেটিংস → অ্যাকাউন্ট → আরেকটি ডিভাইস যোগ করুন খুলুন, তারপর কোডটি এখানে “আমার কাছে কোড আছে” দিয়ে দিন।',
+ 'Ask your admin': 'আপনার অ্যাডমিনকে জিজ্ঞেস করুন',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'যিনি আপনার openGym সার্ভার চালান, তিনি অ্যাডমিন ড্যাশবোর্ডে আপনার জন্য রিকভারি কোড বানাতে পারেন। কোডটি “আমার কাছে কোড আছে” দিয়ে দিন, এই ডিভাইস নতুন পাসকি পাবে।',
+ 'Running the server yourself?': 'সার্ভার নিজেই চালান?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'সার্ভারে যেকোনো প্রোফাইলের রিকভারি কোড নিন, মালিকেরটাও: docker compose exec api node recover.js "আপনার নাম"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'এই অ্যাপে: কোডটি ব্রাউজারে আপনার openGym সাইটে দিন, তারপর সেখানে সেটিংস → অ্যাকাউন্ট থেকে অ্যাপটি আবার পেয়ার করুন।',
+ 'I have a code': 'আমার কাছে কোড আছে',
+ 'A recovery code from your admin goes here too.': 'অ্যাডমিনের দেওয়া রিকভারি কোডও এখানে দিন।',
}
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index c6e416ac5..b52231868 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -2395,4 +2395,17 @@ export default {
'Workout running': 'Training läuft',
'Set {0} of {1}': 'Satz {0} von {1}',
'All sets done': 'Alle Sätze erledigt',
+ 'Lost access?': 'Zugang verloren?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Keine Panik: Dein Training ist sicher auf dem Server. Eins davon bringt dich wieder rein.',
+ 'Your passkey may be synced': 'Dein Passkey ist vielleicht synchronisiert',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Passkeys im iCloud-Schlüsselbund, im Google Passwortmanager oder in einem Passwortmanager sind auch auf deinen anderen Geräten. Versuch dort „Mit Passkey anmelden“.',
+ 'Another device still signed in?': 'Ist noch ein anderes Gerät angemeldet?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'Öffne dort Einstellungen → Konto → Weiteres Gerät hinzufügen und gib den Code hier mit „Ich habe einen Code“ ein.',
+ 'Ask your admin': 'Frag deinen Admin',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Wer deinen openGym-Server betreibt, kann dir im Admin-Bereich einen Wiederherstellungscode erstellen. Gib ihn mit „Ich habe einen Code“ ein, und dieses Gerät bekommt einen neuen Passkey.',
+ 'Running the server yourself?': 'Betreibst du den Server selbst?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'Auf dem Server bekommst du einen Wiederherstellungscode für jedes Profil, auch das des Eigentümers: docker compose exec api node recover.js "Dein Name"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'In dieser App: Gib den Code auf deiner openGym-Seite im Browser ein und kopple die App dann dort unter Einstellungen → Konto neu.',
+ 'I have a code': 'Ich habe einen Code',
+ 'A recovery code from your admin goes here too.': 'Ein Wiederherstellungscode von deinem Admin kommt auch hierher.',
}
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 9f1a47c23..93c622835 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': 'Entreno en curso',
'Set {0} of {1}': 'Serie {0} de {1}',
'All sets done': 'Todas las series hechas',
+ 'Lost access?': '¿Perdiste el acceso?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Tranquilo: tu entrenamiento está a salvo en el servidor. Con una de estas opciones vuelves a entrar.',
+ 'Your passkey may be synced': 'Puede que tu passkey esté sincronizada',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Las passkeys guardadas en el llavero de iCloud, el Gestor de contraseñas de Google o un gestor de contraseñas también están en tus otros dispositivos. Prueba «Iniciar sesión con passkey» allí.',
+ 'Another device still signed in?': '¿Otro dispositivo sigue con la sesión iniciada?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'En ese, abre Ajustes → Cuenta → Añadir otro dispositivo y escribe su código aquí con «Tengo un código».',
+ 'Ask your admin': 'Pregunta a tu admin',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Quien gestiona tu servidor de openGym puede crearte un código de recuperación en el panel de administración. Escríbelo con «Tengo un código» y este dispositivo recibe una passkey nueva.',
+ 'Running the server yourself?': '¿Tienes tu propio servidor?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'En el servidor obtienes un código de recuperación para cualquier perfil, también el del propietario: docker compose exec api node recover.js "Tu nombre"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'En esta app: escribe el código en tu web de openGym en un navegador y luego vuelve a emparejar la app desde Ajustes → Cuenta allí.',
+ 'I have a code': 'Tengo un código',
+ 'A recovery code from your admin goes here too.': 'Un código de recuperación de tu admin también va aquí.',
}
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index 2c6372554..4886896c1 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': 'Séance en cours',
'Set {0} of {1}': 'Série {0} sur {1}',
'All sets done': 'Toutes les séries faites',
+ 'Lost access?': 'Accès perdu ?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Pas de panique : ton entraînement est en sécurité sur le serveur. L’un de ces moyens te fait revenir.',
+ 'Your passkey may be synced': 'Ta passkey est peut-être synchronisée',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Les passkeys gardées dans le trousseau iCloud, le Gestionnaire de mots de passe Google ou un gestionnaire de mots de passe sont aussi sur tes autres appareils. Essaie « Se connecter avec une passkey » là-bas.',
+ 'Another device still signed in?': 'Un autre appareil encore connecté ?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'Sur celui-là, ouvre Réglages → Compte → Ajouter un autre appareil, puis saisis son code ici avec « J’ai un code ».',
+ 'Ask your admin': 'Demande à ton admin',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'La personne qui gère ton serveur openGym peut te créer un code de récupération dans le tableau d’admin. Saisis-le avec « J’ai un code » et cet appareil reçoit une nouvelle passkey.',
+ 'Running the server yourself?': 'Tu héberges toi-même le serveur ?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'Sur le serveur, obtiens un code de récupération pour n’importe quel profil, celui du propriétaire aussi : docker compose exec api node recover.js "Ton nom"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'Dans cette app : saisis le code sur ton site openGym dans un navigateur, puis associe à nouveau l’app depuis Réglages → Compte là-bas.',
+ 'I have a code': 'J’ai un code',
+ 'A recovery code from your admin goes here too.': 'Un code de récupération de ton admin se saisit ici aussi.',
}
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index 1a6fdc5ff..d3527e16c 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': 'वर्कआउट चल रहा है',
'Set {0} of {1}': 'सेट {0} / {1}',
'All sets done': 'सारे सेट पूरे',
+ 'Lost access?': 'एक्सेस खो गया?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'घबराइए नहीं: आपकी ट्रेनिंग सर्वर पर सुरक्षित है। इनमें से कोई एक तरीका आपको वापस ले आएगा।',
+ 'Your passkey may be synced': 'आपकी पासकी सिंक हो सकती है',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'iCloud Keychain, Google Password Manager या किसी पासवर्ड मैनेजर में रखी पासकी आपके दूसरे डिवाइस पर भी होती हैं। वहाँ “पासकी से साइन इन करें” आज़माएँ।',
+ 'Another device still signed in?': 'कोई दूसरा डिवाइस अब भी साइन इन है?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'उस पर सेटिंग्स → खाता → दूसरा डिवाइस जोड़ें खोलें, फिर उसका कोड यहाँ “मेरे पास कोड है” में डालें।',
+ 'Ask your admin': 'अपने एडमिन से पूछें',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'जो आपका openGym सर्वर चलाते हैं, वे एडमिन डैशबोर्ड में आपके लिए रिकवरी कोड बना सकते हैं। उसे “मेरे पास कोड है” में डालें, और इस डिवाइस को नई पासकी मिल जाएगी।',
+ 'Running the server yourself?': 'सर्वर खुद चलाते हैं?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'सर्वर पर किसी भी प्रोफ़ाइल का रिकवरी कोड पाएँ, मालिक का भी: docker compose exec api node recover.js "आपका नाम"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'इस ऐप में: कोड को ब्राउज़र में अपनी openGym साइट पर डालें, फिर वहाँ सेटिंग्स → खाता से ऐप को फिर से पेयर करें।',
+ 'I have a code': 'मेरे पास कोड है',
+ 'A recovery code from your admin goes here too.': 'एडमिन से मिला रिकवरी कोड भी यहीं डालें।',
}
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index ebd969c95..764966c48 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -2378,4 +2378,17 @@ export default {
'Workout running': 'Edzés folyamatban',
'Set {0} of {1}': '{0}. sorozat / {1}',
'All sets done': 'Minden sorozat kész',
+ 'Lost access?': 'Nem tudsz belépni?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Semmi pánik: az edzéseid biztonságban vannak a szerveren. Ezek egyikével visszajutsz.',
+ 'Your passkey may be synced': 'Lehet, hogy a jelszókulcsod szinkronizálva van',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Az iCloud-kulcskarikában, a Google Jelszókezelőben vagy egy jelszókezelőben tárolt jelszókulcsok a többi eszközödön is ott vannak. Próbáld ott a „Bejelentkezés jelszókulccsal” lehetőséget.',
+ 'Another device still signed in?': 'Egy másik eszközöd még be van jelentkezve?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'Azon nyisd meg a Beállítások → Fiók → Másik eszköz hozzáadása menüt, és itt add meg a kódot a „Van kódom” gombbal.',
+ 'Ask your admin': 'Kérdezd meg az adminodat',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Aki az openGym-szerveredet üzemelteti, az admin felületen helyreállító kódot készíthet neked. Add meg a „Van kódom” gombbal, és ez az eszköz új jelszókulcsot kap.',
+ 'Running the server yourself?': 'Te üzemelteted a szervert?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'A szerveren bármely profilhoz kérhetsz helyreállító kódot, a tulajdonoséhoz is: docker compose exec api node recover.js "A neved"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'Ebben az appban: add meg a kódot az openGym-oldaladon egy böngészőben, aztán párosítsd újra az appot ott a Beállítások → Fiók menüben.',
+ 'I have a code': 'Van kódom',
+ 'A recovery code from your admin goes here too.': 'Az admintól kapott helyreállító kód is ide kerül.',
}
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index 4ef0209db..689606e70 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': 'Allenamento in corso',
'Set {0} of {1}': 'Serie {0} di {1}',
'All sets done': 'Tutte le serie fatte',
+ 'Lost access?': 'Accesso perso?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Niente panico: il tuo allenamento è al sicuro sul server. Una di queste strade ti riporta dentro.',
+ 'Your passkey may be synced': 'La tua passkey potrebbe essere sincronizzata',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Le passkey salvate nel portachiavi iCloud, nel Gestore delle password di Google o in un gestore di password sono anche sugli altri tuoi dispositivi. Prova «Accedi con passkey» lì.',
+ 'Another device still signed in?': 'Un altro dispositivo è ancora connesso?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'Lì apri Impostazioni → Account → Aggiungi un altro dispositivo, poi inserisci il codice qui con «Ho un codice».',
+ 'Ask your admin': 'Chiedi al tuo admin',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Chi gestisce il tuo server openGym può crearti un codice di recupero nella dashboard admin. Inseriscilo con «Ho un codice» e questo dispositivo riceve una nuova passkey.',
+ 'Running the server yourself?': 'Gestisci tu il server?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'Sul server ottieni un codice di recupero per qualsiasi profilo, anche quello del proprietario: docker compose exec api node recover.js "Il tuo nome"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'In questa app: inserisci il codice sul tuo sito openGym in un browser, poi abbina di nuovo l’app da Impostazioni → Account lì.',
+ 'I have a code': 'Ho un codice',
+ 'A recovery code from your admin goes here too.': 'Anche un codice di recupero del tuo admin va qui.',
}
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index c8f8367ef..7da90a36d 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': '운동 중',
'Set {0} of {1}': '{1}세트 중 {0}세트',
'All sets done': '모든 세트 완료',
+ 'Lost access?': '접근할 수 없나요?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': '걱정 마세요. 운동 기록은 서버에 안전하게 있어요. 아래 방법 중 하나로 다시 들어올 수 있어요.',
+ 'Your passkey may be synced': '패스키가 동기화되어 있을 수 있어요',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'iCloud 키체인, Google 비밀번호 관리자나 비밀번호 관리 앱에 저장된 패스키는 다른 기기에도 있어요. 그 기기에서 ‘패스키로 로그인’을 해 보세요.',
+ 'Another device still signed in?': '아직 로그인된 다른 기기가 있나요?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': '그 기기에서 설정 → 계정 → 다른 기기 추가를 열고, 여기서 ‘코드가 있어요’로 코드를 입력하세요.',
+ 'Ask your admin': '관리자에게 요청하기',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'openGym 서버를 운영하는 사람이 관리자 화면에서 복구 코드를 만들어 줄 수 있어요. ‘코드가 있어요’로 입력하면 이 기기에 새 패스키가 생겨요.',
+ 'Running the server yourself?': '서버를 직접 운영하나요?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': '서버에서 소유자를 포함한 모든 프로필의 복구 코드를 받을 수 있어요: docker compose exec api node recover.js "내 이름"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': '이 앱에서는: 브라우저로 openGym 사이트에 코드를 입력한 뒤, 거기서 설정 → 계정에서 앱을 다시 페어링하세요.',
+ 'I have a code': '코드가 있어요',
+ 'A recovery code from your admin goes here too.': '관리자에게 받은 복구 코드도 여기에 입력하면 돼요.',
}
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index d51462c9d..80cfa3df4 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': 'Trening trwa',
'Set {0} of {1}': 'Seria {0} z {1}',
'All sets done': 'Wszystkie serie zrobione',
+ 'Lost access?': 'Utracony dostęp?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Bez paniki: twoje treningi są bezpieczne na serwerze. Jeden z tych sposobów przywróci ci dostęp.',
+ 'Your passkey may be synced': 'Twój klucz dostępu może być zsynchronizowany',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Klucze dostępu z pęku kluczy iCloud, Menedżera haseł Google lub menedżera haseł są też na twoich innych urządzeniach. Spróbuj tam „Zaloguj się kluczem dostępu”.',
+ 'Another device still signed in?': 'Inne urządzenie jest wciąż zalogowane?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'Tam otwórz Ustawienia → Konto → Dodaj kolejne urządzenie i wpisz kod tutaj przez „Mam kod”.',
+ 'Ask your admin': 'Zapytaj administratora',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Osoba, która prowadzi twój serwer openGym, może utworzyć ci kod odzyskiwania w panelu administratora. Wpisz go przez „Mam kod”, a to urządzenie dostanie nowy klucz dostępu.',
+ 'Running the server yourself?': 'Sam prowadzisz serwer?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'Na serwerze dostaniesz kod odzyskiwania dla każdego profilu, także właściciela: docker compose exec api node recover.js "Twoje imię"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'W tej aplikacji: wpisz kod na swojej stronie openGym w przeglądarce, a potem sparuj aplikację ponownie w Ustawienia → Konto.',
+ 'I have a code': 'Mam kod',
+ 'A recovery code from your admin goes here too.': 'Kod odzyskiwania od administratora też wpisujesz tutaj.',
}
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index 8ba2e9e19..9e85d3191 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -1500,6 +1500,18 @@ export const PT_BR_OVERRIDES = {
'Switch it off anytime in Settings': 'Desligue quando quiser nas Configurações',
'You can change it anytime in Settings.': 'Você pode mudar isso quando quiser nas Configurações.',
'Workout running': 'Treino em andamento',
+ 'Lost access?': 'Perdeu o acesso?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Calma: seu treino está seguro no servidor. Uma destas opções devolve seu acesso.',
+ 'Your passkey may be synced': 'Sua chave de acesso pode estar sincronizada',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Chaves de acesso salvas no Chaveiro do iCloud, no Gerenciador de Senhas do Google ou em um gerenciador de senhas também estão nos seus outros dispositivos. Tente “Entrar com chave de acesso” lá.',
+ 'Another device still signed in?': 'Outro dispositivo ainda conectado?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'Nele, abra Configurações → Conta → Adicionar outro dispositivo e digite o código aqui em “Tenho um código”.',
+ 'Ask your admin': 'Peça ao seu admin',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Quem administra seu servidor openGym pode criar um código de recuperação no painel de admin. Digite-o em “Tenho um código” e este dispositivo ganha uma nova chave de acesso.',
+ 'Running the server yourself?': 'Você mesmo administra o servidor?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'No servidor, gere um código de recuperação para qualquer perfil, inclusive o do dono: docker compose exec api node recover.js "Seu nome"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'Neste aplicativo: digite o código no seu site openGym em um navegador e depois pareie o aplicativo de novo em Configurações → Conta lá.',
+ 'A recovery code from your admin goes here too.': 'Um código de recuperação do seu admin também vai aqui.',
}
export default { ...pt, ...PT_BR_OVERRIDES }
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index aefccb1a1..6cb85356e 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': 'Treino a decorrer',
'Set {0} of {1}': 'Série {0} de {1}',
'All sets done': 'Todas as séries feitas',
+ 'Lost access?': 'Perdeste o acesso?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Calma: o teu treino está seguro no servidor. Uma destas opções volta a dar-te acesso.',
+ 'Your passkey may be synced': 'A tua passkey pode estar sincronizada',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'As passkeys guardadas no Porta-chaves iCloud, no Gestor de Palavras-passe da Google ou num gestor de palavras-passe também estão nos teus outros dispositivos. Experimenta «Entrar com passkey» lá.',
+ 'Another device still signed in?': 'Outro dispositivo ainda com sessão iniciada?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'Nesse, abre Definições → Conta → Adicionar outro dispositivo e introduz aqui o código com «Tenho um código».',
+ 'Ask your admin': 'Pede ao teu admin',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Quem gere o teu servidor openGym pode criar-te um código de recuperação no painel de administração. Introduz-o com «Tenho um código» e este dispositivo recebe uma passkey nova.',
+ 'Running the server yourself?': 'És tu que geres o servidor?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'No servidor, obtém um código de recuperação para qualquer perfil, incluindo o do proprietário: docker compose exec api node recover.js "O teu nome"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'Nesta app: introduz o código no teu site openGym num navegador e depois emparelha a app de novo em Definições → Conta lá.',
+ 'I have a code': 'Tenho um código',
+ 'A recovery code from your admin goes here too.': 'Um código de recuperação do teu admin também vai aqui.',
}
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index 5975d6d5a..d52ee550a 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -2379,4 +2379,17 @@ export default {
'Workout running': 'Тренировка идёт',
'Set {0} of {1}': 'Подход {0} из {1}',
'All sets done': 'Все подходы сделаны',
+ 'Lost access?': 'Потеряли доступ?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Без паники: ваши тренировки в сохранности на сервере. Один из этих способов вернёт доступ.',
+ 'Your passkey may be synced': 'Ключ доступа может быть синхронизирован',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Ключи доступа из Связки ключей iCloud, Диспетчера паролей Google или менеджера паролей есть и на других ваших устройствах. Попробуйте там «Войти по ключу доступа».',
+ 'Another device still signed in?': 'Другое устройство ещё в аккаунте?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'На нём откройте Настройки → Аккаунт → Добавить другое устройство и введите код здесь через «У меня есть код».',
+ 'Ask your admin': 'Спросите администратора',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Тот, кто управляет вашим сервером openGym, может создать код восстановления в панели администратора. Введите его через «У меня есть код», и это устройство получит новый ключ доступа.',
+ 'Running the server yourself?': 'Сервер ваш собственный?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'На сервере можно получить код восстановления для любого профиля, в том числе владельца: docker compose exec api node recover.js "Ваше имя"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'В этом приложении: введите код на своём сайте openGym в браузере, затем снова выполните сопряжение приложения в Настройки → Аккаунт там.',
+ 'I have a code': 'У меня есть код',
+ 'A recovery code from your admin goes here too.': 'Код восстановления от администратора тоже вводится здесь.',
}
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index 05f005b59..3b6284d5a 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -2386,4 +2386,17 @@ export default {
'Workout running': 'กำลังฝึกอยู่',
'Set {0} of {1}': 'เซ็ต {0} จาก {1}',
'All sets done': 'ครบทุกเซ็ตแล้ว',
+ 'Lost access?': 'เข้าใช้งานไม่ได้?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'ไม่ต้องกังวล การฝึกของคุณปลอดภัยอยู่บนเซิร์ฟเวอร์ วิธีใดวิธีหนึ่งต่อไปนี้จะพาคุณกลับเข้ามา',
+ 'Your passkey may be synced': 'พาสคีย์ของคุณอาจซิงค์อยู่แล้ว',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'พาสคีย์ที่เก็บใน iCloud Keychain, Google Password Manager หรือโปรแกรมจัดการรหัสผ่านจะอยู่ในอุปกรณ์อื่นของคุณด้วย ลอง “เข้าสู่ระบบด้วยพาสคีย์” ที่นั่น',
+ 'Another device still signed in?': 'มีอุปกรณ์อื่นที่ยังเข้าสู่ระบบอยู่ไหม',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'ที่เครื่องนั้น เปิด ตั้งค่า → บัญชี → เพิ่มอุปกรณ์อื่น แล้วใส่รหัสที่นี่ผ่าน “ฉันมีรหัส”',
+ 'Ask your admin': 'ถามผู้ดูแลระบบ',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'ผู้ที่ดูแลเซิร์ฟเวอร์ openGym ของคุณสร้างรหัสกู้คืนให้ได้ในแดชบอร์ดผู้ดูแล ใส่รหัสผ่าน “ฉันมีรหัส” แล้วอุปกรณ์นี้จะได้พาสคีย์ใหม่',
+ 'Running the server yourself?': 'คุณดูแลเซิร์ฟเวอร์เองหรือเปล่า',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'ขอรหัสกู้คืนของโปรไฟล์ใดก็ได้บนเซิร์ฟเวอร์ รวมถึงของเจ้าของ: docker compose exec api node recover.js "ชื่อของคุณ"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'ในแอปนี้: ใส่รหัสในเว็บ openGym ของคุณผ่านเบราว์เซอร์ แล้วจับคู่แอปใหม่จาก ตั้งค่า → บัญชี ที่นั่น',
+ 'I have a code': 'ฉันมีรหัส',
+ 'A recovery code from your admin goes here too.': 'รหัสกู้คืนจากผู้ดูแลก็ใส่ที่นี่ได้',
}
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index b246d4897..2a74b4997 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': 'Antrenman sürüyor',
'Set {0} of {1}': 'Set {0}/{1}',
'All sets done': 'Tüm setler tamam',
+ 'Lost access?': 'Erişimi mi kaybettin?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Panik yok: antrenmanların sunucuda güvende. Bunlardan biri seni geri sokar.',
+ 'Your passkey may be synced': 'Geçiş anahtarın eşitlenmiş olabilir',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'iCloud Anahtar Zinciri, Google Şifre Yöneticisi ya da bir şifre yöneticisinde saklanan geçiş anahtarları diğer cihazlarında da var. Orada “Geçiş anahtarıyla giriş yap”ı dene.',
+ 'Another device still signed in?': 'Başka bir cihazda hâlâ oturum açık mı?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'O cihazda Ayarlar → Hesap → Başka bir cihaz ekle’yi aç, sonra kodu burada “Kodum var” ile gir.',
+ 'Ask your admin': 'Yöneticine sor',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'openGym sunucunu yöneten kişi, yönetim panelinden sana bir kurtarma kodu oluşturabilir. Kodu “Kodum var” ile gir, bu cihaz yeni bir geçiş anahtarı alır.',
+ 'Running the server yourself?': 'Sunucuyu kendin mi çalıştırıyorsun?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'Sunucuda her profil için, sahibininki dahil, kurtarma kodu al: docker compose exec api node recover.js "Adın"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'Bu uygulamada: kodu bir tarayıcıda openGym sitene gir, sonra uygulamayı oradaki Ayarlar → Hesap’tan yeniden eşleştir.',
+ 'I have a code': 'Kodum var',
+ 'A recovery code from your admin goes here too.': 'Yöneticinden aldığın kurtarma kodu da buraya girilir.',
}
diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.js
index 13e7e55a5..83678f78d 100644
--- a/frontend/src/locales/uk.js
+++ b/frontend/src/locales/uk.js
@@ -2372,4 +2372,17 @@ export default {
'Workout running': 'Тренування триває',
'Set {0} of {1}': 'Підхід {0} з {1}',
'All sets done': 'Усі підходи зроблено',
+ 'Lost access?': 'Втратив доступ?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': 'Без паніки: твої тренування в безпеці на сервері. Один із цих способів поверне доступ.',
+ 'Your passkey may be synced': 'Ключ доступу може бути синхронізований',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': 'Ключі доступу зі Зв’язки ключів iCloud, Менеджера паролів Google або менеджера паролів є й на інших твоїх пристроях. Спробуй там «Увійти за ключем доступу».',
+ 'Another device still signed in?': 'Інший пристрій ще в акаунті?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': 'На ньому відкрий Налаштування → Акаунт → Додати інший пристрій і введи код тут через «У мене є код».',
+ 'Ask your admin': 'Запитай адміністратора',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': 'Той, хто керує твоїм сервером openGym, може створити код відновлення в панелі адміністратора. Введи його через «У мене є код», і цей пристрій отримає новий ключ доступу.',
+ 'Running the server yourself?': 'Сервер твій власний?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': 'На сервері можна отримати код відновлення для будь-якого профілю, зокрема власника: docker compose exec api node recover.js "Твоє ім’я"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': 'У цьому застосунку: введи код на своєму сайті openGym у браузері, а потім знову спаруй застосунок у Налаштування → Акаунт там.',
+ 'I have a code': 'У мене є код',
+ 'A recovery code from your admin goes here too.': 'Код відновлення від адміністратора теж вводиться тут.',
}
diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.js
index 3ec8840b7..df1eb4ce1 100644
--- a/frontend/src/locales/zh-TW.js
+++ b/frontend/src/locales/zh-TW.js
@@ -2368,4 +2368,17 @@ export default {
'Workout running': '訓練進行中',
'Set {0} of {1}': '第 {0} 組,共 {1} 組',
'All sets done': '所有組已完成',
+ 'Lost access?': '無法登入?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': '別慌:你的訓練資料安全地保存在伺服器上。下面任一方法都能讓你重新登入。',
+ 'Your passkey may be synced': '你的通行密鑰可能已同步',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': '存放在 iCloud 鑰匙圈、Google 密碼管理工具或密碼管理器中的通行密鑰也在你的其他裝置上。在那裡試試「使用通行密鑰登入」。',
+ 'Another device still signed in?': '還有其他裝置保持登入?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': '在那台裝置上打開 設定 → 帳號 → 新增其他裝置,然後在這裡透過「我有代碼」輸入代碼。',
+ 'Ask your admin': '詢問管理員',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': '運行你的 openGym 伺服器的人可以在管理後台為你產生復原代碼。透過「我有代碼」輸入後,這台裝置會取得新的通行密鑰。',
+ 'Running the server yourself?': '伺服器是你自己運行的?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': '在伺服器上為任何個人檔案(包括擁有者)產生復原代碼:docker compose exec api node recover.js "你的名字"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': '在此 App 中:先在瀏覽器裡的 openGym 網站輸入代碼,然後在那裡的 設定 → 帳號 中重新配對 App。',
+ 'I have a code': '我有代碼',
+ 'A recovery code from your admin goes here too.': '管理員給你的復原代碼也在這裡輸入。',
}
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index a8b7325e9..66c4eb98d 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -2375,4 +2375,17 @@ export default {
'Workout running': '训练进行中',
'Set {0} of {1}': '第 {0} 组,共 {1} 组',
'All sets done': '所有组已完成',
+ 'Lost access?': '无法登录?',
+ 'No panic: your training is safe on the server. One of these gets you back in.': '别慌:你的训练数据安全地保存在服务器上。下面任一方法都能让你重新登录。',
+ 'Your passkey may be synced': '你的通行密钥可能已同步',
+ 'Passkeys kept in iCloud Keychain, Google Password Manager or a password manager are on your other devices too. Try “Sign in with passkey” there.': '保存在 iCloud 钥匙串、Google 密码管理工具或密码管理器中的通行密钥也在你的其他设备上。在那里试试“用通行密钥登录”。',
+ 'Another device still signed in?': '还有其他设备处于登录状态?',
+ 'On that one, open Settings → Account → Add another device, then enter its code here with “I have a code”.': '在那台设备上打开 设置 → 账号 → 添加其他设备,然后在这里通过“我有代码”输入代码。',
+ 'Ask your admin': '询问管理员',
+ 'Whoever runs your openGym server can make you a recovery code in the admin dashboard. Enter it with “I have a code”, and this device gets a new passkey.': '运行你的 openGym 服务器的人可以在管理后台为你生成恢复代码。通过“我有代码”输入后,这台设备会获得新的通行密钥。',
+ 'Running the server yourself?': '服务器是你自己运行的?',
+ 'Get a recovery code for any profile, the owner’s too, on the server: docker compose exec api node recover.js "Your name"': '在服务器上为任何个人资料(包括所有者)生成恢复代码:docker compose exec api node recover.js "你的名字"',
+ 'In this app: enter the code on your openGym site in a browser, then pair the app again from Settings → Account there.': '在此应用中:先在浏览器里的 openGym 网站输入代码,然后在那里的 设置 → 账号 中重新配对应用。',
+ 'I have a code': '我有代码',
+ 'A recovery code from your admin goes here too.': '管理员给你的恢复代码也在这里输入。',
}
diff --git a/frontend/src/views/Login.jsx b/frontend/src/views/Login.jsx
index 714d9bf2b..a7209b412 100644
--- a/frontend/src/views/Login.jsx
+++ b/frontend/src/views/Login.jsx
@@ -11,6 +11,7 @@ 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'
+import { openLostAccess } from '../components/LostAccess.jsx'
function RegisterSheet({ close }) {
const { setUser, pushState, pullState, loadConfig } = useStore()
@@ -109,6 +110,8 @@ export default function Login() {
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>
+ {/* No device signs you in any more (#584): what to try, and where a recovery code goes. */}
+ <Button variant="ghost" className="dim" onClick={openLostAccess}>{t('Lost access?')}</Button>
{canGuest && <div style={{ height: 4 }} />}
</> : pwOn ? <>
{/* Plain http on a LAN address, or a browser without passkey support: the password is
@@ -117,6 +120,7 @@ export default function Login() {
<Button variant="primary" icon="key" onClick={() => openPasswordSignIn()}>{t('Sign in with password')}</Button>
<div style={{ height: 10 }} />
<Button icon="plusCircle" onClick={register}>{t('Create new profile')}</Button>
+ <Button variant="ghost" className="dim" onClick={openLostAccess}>{t('Lost access?')}</Button>
{canGuest && <div style={{ height: 10 }} />}
</> : <div className="card small muted" style={{ textAlign: 'start' }}>{canGuest
? t("This browser doesn't do passkeys, but you can still use openGym locally on this device.")
diff --git a/frontend/src/views/Login.lost-access.test.jsx b/frontend/src/views/Login.lost-access.test.jsx
new file mode 100644
index 000000000..88a388a74
--- /dev/null
+++ b/frontend/src/views/Login.lost-access.test.jsx
@@ -0,0 +1,98 @@
+// @vitest-environment happy-dom
+import React, { act } from 'react'
+import { createRoot } from 'react-dom/client'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+globalThis.IS_REACT_ACT_ENVIRONMENT = true
+
+/* "Lost access?" on the sign-in screen (#584): what to try when no device signs you in, in order,
+ and "I have a code", which redeems a recovery code like a device link. The phone app cannot
+ make a passkey for the server, so there it says to use a browser and pair again. */
+const mocks = vi.hoisted(() => {
+ const state = { webauthn: true, config: null, sheets: [], MOBILE: false, redeem: null }
+ 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', bio: () => 'your fingerprint',
+ api: vi.fn(), passkeyAssertion: vi.fn(), passwordLogin: vi.fn(), passwordRegister: vi.fn(), passwordResetRedeem: vi.fn(),
+ createPasskey: vi.fn(),
+}))
+vi.mock('../lib/mobile.js', () => ({ get MOBILE() { return mocks.MOBILE }, nativePlatform: async () => null, isAndroid: async () => false }))
+vi.mock('../components/Passkeys.jsx', () => ({ openDeviceLinkRedeem: vi.fn(() => { mocks.redeem = true }) }))
+vi.mock('../lib/demo.js', () => ({ DEMO: false, REPO: 'https://example.invalid' }))
+vi.mock('../sheets.jsx', () => ({ askAddDeviceData: vi.fn(), confirmSheet: vi.fn() }))
+
+const { default: Login } = await import('./Login.jsx')
+const { LostAccessSheet } = await import('../components/LostAccess.jsx')
+
+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 button = (host, text) => [...host.querySelectorAll('button')].find(b => b.textContent.trim() === text)
+
+beforeEach(() => { mocks.webauthn = true; mocks.config = null; mocks.sheets.length = 0; mocks.MOBILE = false; mocks.redeem = null })
+afterEach(() => { act(() => { mounted.splice(0).forEach(({ root, host }) => { root.unmount(); host.remove() }) }) })
+
+describe('Login: Lost access?', () => {
+ it('sits under the code button where passkeys work, and opens the steps', () => {
+ const page = mount(<Login />)
+ const all = [...page.querySelectorAll('button')].map(b => b.textContent.trim())
+ expect(all.indexOf('Lost access?')).toBe(all.indexOf('Use a code from your other device') + 1)
+ act(() => button(page, 'Lost access?').click())
+ expect(mocks.sheets).toHaveLength(1)
+ })
+ it('is there on a password-only browser too', () => {
+ mocks.webauthn = false
+ mocks.config = { password_login: true }
+ const page = mount(<Login />)
+ expect(button(page, 'Lost access?')).toBeTruthy()
+ })
+})
+
+describe('LostAccessSheet', () => {
+ it('lists the ways back in, in order, with the server command, and no em dash', () => {
+ const close = vi.fn()
+ const host = mount(<LostAccessSheet close={close} />)
+ const text = host.textContent
+ const order = ['Your passkey may be synced', 'Another device still signed in?', 'Ask your admin', 'Running the server yourself?'].map(s => text.indexOf(s))
+ expect(order.every(i => i >= 0)).toBe(true)
+ expect([...order].sort((a, b) => a - b)).toEqual(order)
+ expect(text).toContain('docker compose exec api node recover.js')
+ expect(text).not.toMatch(/—/)
+ })
+ it('"I have a code" opens the redemption a device link has', () => {
+ const close = vi.fn()
+ const host = mount(<LostAccessSheet close={close} />)
+ act(() => button(host, 'I have a code').click())
+ expect(close).toHaveBeenCalled()
+ expect(mocks.redeem).toBe(true)
+ })
+ it('in the phone app: a browser first, then pair again; no code field here', () => {
+ mocks.MOBILE = true
+ const host = mount(<LostAccessSheet close={vi.fn()} />)
+ expect(host.textContent).toContain('pair the app again')
+ expect(button(host, 'I have a code')).toBeUndefined()
+ })
+})
diff --git a/frontend/src/views/Login.password.test.jsx b/frontend/src/views/Login.password.test.jsx
index 2de64714b..5d824e8e2 100644
--- a/frontend/src/views/Login.password.test.jsx
+++ b/frontend/src/views/Login.password.test.jsx
@@ -79,7 +79,7 @@ describe('Login with password sign-in', () => {
const page = mount(<Login />)
expect(page.textContent).toContain("This browser doesn't support passkeys. Sign in with your name and password instead.")
expect(page.textContent).not.toContain('Try a browser or device with passkey support.')
- expect(buttons(page)).toEqual(['Sign in with password', 'Create new profile'])
+ expect(buttons(page)).toEqual(['Sign in with password', 'Create new profile', 'Lost access?'])
// Creating a profile here can only mean a password: no passkey/password choice to make.
act(() => button(page, 'Create new profile').click())
const sheet = mount(mocks.sheets[0](() => {}))
diff --git a/frontend/src/views/MobileOnboarding.jsx b/frontend/src/views/MobileOnboarding.jsx
index b40d80be3..127ee807d 100644
--- a/frontend/src/views/MobileOnboarding.jsx
+++ b/frontend/src/views/MobileOnboarding.jsx
@@ -4,6 +4,7 @@
import { useState, useRef, useEffect } from 'react'
import { useStore } from '../store/useStore.js'
import { useUI } from '../store/useUI.js'
+import { openLostAccess } from '../components/LostAccess.jsx'
import { t } from '../lib/i18n.js'
import Icon from '../components/Icon.jsx'
import { Button } from '../components/ui.jsx'
@@ -133,6 +134,7 @@ export function ConnectSheet({ close, initialUrl = '', again = false }) {
<Button variant="primary" onClick={go} disabled={busy}>{busy ? t('Connecting…') : t('Connect')}</Button>
<div style={{ height: 10 }} />
<Button icon="key" onClick={() => openCfAccess(normalizeServerUrl(url) || '')} disabled={busy}>{t('Cloudflare Access')}</Button>
+ <Button variant="ghost" className="dim" onClick={openLostAccess} disabled={busy}>{t('Lost access?')}</Button>
</div>
}