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.

Settings: a guest can make a password profile or use a device code

Duarte Santos8c5313b66094
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.js
index 33fc67749..141badc71 100644
--- a/frontend/src/locales/ar.js
+++ b/frontend/src/locales/ar.js
@@ -1955,4 +1955,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'هذا الخادم لا يعرف مفتاح المرور هذا. أنشئ ملفًا شخصيًا أولًا.',
'That took a little too long. Give it another go.': 'استغرق ذلك وقتًا أطول قليلًا من اللازم. جرّب مرة أخرى.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'لم ينجح هذا الرمز. الرموز صالحة لمدة 5 دقائق ولمرة واحدة فقط، فاطلب رمزًا جديدًا.',
+ 'Create profile with a password': 'إنشاء ملف شخصي بكلمة مرور',
}
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index ae1b6b0b6..5b11386c2 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -1922,4 +1922,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Diesen Passkey kennt der Server nicht. Erstell zuerst ein Profil.',
'That took a little too long. Give it another go.': 'Das hat etwas zu lange gedauert. Versuch es gleich noch mal.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Der Code hat nicht geklappt. Codes gelten 5 Minuten und nur einmal, also hol dir einen frischen.',
+ 'Create profile with a password': 'Profil mit Passwort erstellen',
}
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 1c5b7f9d5..dea765ad8 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Este servidor no conoce esa passkey. Crea un perfil primero.',
'That took a little too long. Give it another go.': 'Eso tardó un poco de más. Inténtalo otra vez.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Ese código no funcionó. Los códigos duran 5 minutos y sirven una sola vez, así que pide uno nuevo.',
+ 'Create profile with a password': 'Crear perfil con contraseña',
}
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index 441b95301..52a520745 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Ce serveur ne connaît pas cette passkey. Crée d’abord un profil.',
'That took a little too long. Give it another go.': 'C’était un peu trop long. Réessaie.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Ce code n’a pas marché. Un code dure 5 minutes et ne sert qu’une fois, alors prends-en un tout neuf.',
+ 'Create profile with a password': 'Créer un profil avec un mot de passe',
}
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index b93597262..6042d6301 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'यह सर्वर इस पासकी को नहीं पहचानता। पहले एक प्रोफ़ाइल बनाएँ।',
'That took a little too long. Give it another go.': 'इसमें थोड़ा ज़्यादा समय लग गया। एक बार फिर कोशिश करें।',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'यह कोड काम नहीं किया। कोड 5 मिनट चलते हैं और सिर्फ़ एक बार काम करते हैं, तो एक नया कोड ले लें।',
+ 'Create profile with a password': 'पासवर्ड के साथ प्रोफ़ाइल बनाएँ',
}
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index b0417c8c6..679fc7e6b 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -1905,4 +1905,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Ez a szerver nem ismeri ezt a jelszókulcsot. Előbb hozz létre egy profilt.',
'That took a little too long. Give it another go.': 'Ez egy kicsit túl sokáig tartott. Próbáld újra.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Ez a kód nem működött. A kódok 5 percig érvényesek és csak egyszer használhatók, úgyhogy kérj egy újat.',
+ 'Create profile with a password': 'Profil létrehozása jelszóval',
}
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index 1d93ffa07..26829fee0 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Questo server non conosce questa passkey. Crea prima un profilo.',
'That took a little too long. Give it another go.': 'Ci è voluto un po’ troppo. Riprova.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Questo codice non ha funzionato. I codici durano 5 minuti e valgono una volta sola, quindi prendine uno nuovo.',
+ 'Create profile with a password': 'Crea profilo con password',
}
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index 7c16dee66..1242f7a56 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': '이 서버는 이 패스키를 몰라요. 먼저 프로필을 만들어 주세요.',
'That took a little too long. Give it another go.': '조금 너무 오래 걸렸어요. 다시 해 보세요.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': '이 코드는 안 됐어요. 코드는 5분 동안 한 번만 쓸 수 있으니 새 코드를 받아 주세요.',
+ 'Create profile with a password': '비밀번호로 프로필 만들기',
}
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index 067154ff1..ad827a0f4 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Ten serwer nie zna tego passkey. Najpierw utwórz profil.',
'That took a little too long. Give it another go.': 'Trwało to trochę za długo. Spróbuj jeszcze raz.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Ten kod nie zadziałał. Kody są ważne 5 minut i działają raz, więc weź świeży.',
+ 'Create profile with a password': 'Utwórz profil z hasłem',
}
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index 7541d3702..90060ed15 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -1181,6 +1181,7 @@ export const PT_BR_OVERRIDES = {
'This server doesn’t know that passkey. Make a profile first.': 'Este servidor não conhece essa chave de acesso. Crie um perfil primeiro.',
'That took a little too long. Give it another go.': 'Demorou um pouquinho demais. Tente de novo.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Esse código não funcionou. Os códigos duram 5 minutos e só valem uma vez, então pegue um novo.',
+ 'Create profile with a password': 'Criar perfil com senha',
}
export default { ...pt, ...PT_BR_OVERRIDES }
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index a9fb4c9ac..fd5d9ead3 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Este servidor não conhece essa passkey. Cria primeiro um perfil.',
'That took a little too long. Give it another go.': 'Demorou um bocadinho demais. Tenta outra vez.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Esse código não funcionou. Os códigos duram 5 minutos e só servem uma vez, por isso pede um novo.',
+ 'Create profile with a password': 'Criar perfil com palavra-passe',
}
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index c16ff3097..041387566 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -1906,4 +1906,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Этот сервер не знает такой ключ доступа. Сначала создайте профиль.',
'That took a little too long. Give it another go.': 'Это заняло слишком много времени. Попробуйте ещё раз.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Этот код не сработал. Коды действуют 5 минут и только один раз, так что возьмите свежий.',
+ 'Create profile with a password': 'Создать профиль с паролем',
}
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index 0d8053273..efea72a3b 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -1913,4 +1913,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'เซิร์ฟเวอร์นี้ไม่รู้จักพาสคีย์นี้ สร้างโปรไฟล์ก่อนนะ',
'That took a little too long. Give it another go.': 'ใช้เวลานานไปหน่อย ลองอีกครั้งนะ',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'รหัสนี้ใช้ไม่ได้ รหัสใช้ได้ 5 นาทีและใช้ได้ครั้งเดียว ขอรหัสใหม่นะ',
+ 'Create profile with a password': 'สร้างโปรไฟล์ด้วยรหัสผ่าน',
}
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index 00f1f55d6..423a56dfe 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Bu sunucu o geçiş anahtarını tanımıyor. Önce bir profil oluştur.',
'That took a little too long. Give it another go.': 'Bu biraz fazla uzun sürdü. Bir kez daha dene.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Bu kod işe yaramadı. Kodlar 5 dakika geçerli ve tek kullanımlık, yenisini al.',
+ 'Create profile with a password': 'Şifreyle profil oluştur',
}
diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.js
index 473d31761..52479e318 100644
--- a/frontend/src/locales/uk.js
+++ b/frontend/src/locales/uk.js
@@ -1899,4 +1899,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': 'Цей сервер не знає такого ключа доступу. Спершу створіть профіль.',
'That took a little too long. Give it another go.': 'Це тривало трохи задовго. Спробуйте ще раз.',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': 'Цей код не спрацював. Коди діють 5 хвилин і лише один раз, тож візьміть свіжий.',
+ 'Create profile with a password': 'Створити профіль з паролем',
}
diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.js
index b10d4031b..9020ee1ea 100644
--- a/frontend/src/locales/zh-TW.js
+++ b/frontend/src/locales/zh-TW.js
@@ -1895,4 +1895,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': '這個伺服器不認得這個通行密鑰。請先建立個人檔案。',
'That took a little too long. Give it another go.': '花的時間有點太久了。再試一次吧。',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': '這個代碼沒用。代碼只在 5 分鐘內有效,而且只能用一次,換個新的吧。',
+ 'Create profile with a password': '用密碼建立個人檔案',
}
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index 4a8f19a09..966f906a5 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -1902,4 +1902,5 @@ export default {
'This server doesn’t know that passkey. Make a profile first.': '这个服务器不认识这个通行密钥。请先创建个人资料。',
'That took a little too long. Give it another go.': '花的时间有点太长了。再试一次吧。',
'That code didn’t work. Codes last 5 minutes and work once, so grab a fresh one.': '这个代码没用。代码只在 5 分钟内有效,且只能用一次,换个新的吧。',
+ 'Create profile with a password': '用密码创建个人资料',
}
diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsx
index a9b26aeb4..0a15d1d01 100644
--- a/frontend/src/views/Settings.jsx
+++ b/frontend/src/views/Settings.jsx
@@ -34,7 +34,7 @@ import { durationSheet } from '../components/DurationWheel.jsx'
import BackupFolderRow, { useBackupFolder, autoBackupSubtitle } from '../components/BackupFolderRow.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 { usePasskeys, PasskeysRow, DeviceLinkRow, openDeviceLinkRedeem } from '../components/Passkeys.jsx'
import { Section, Row, SelectRow, Switch, Segmented, Button, TextField, SearchField } from '../components/ui.jsx'
import { PAGES, ROOT_GROUPS, pageVisible, searchSettings, pageTrail } from './settings-pages.js'
@@ -834,7 +834,10 @@ export default function Settings({ page = null, find = null, via = null }) {
</> : webauthnOK() ? <>
<Row icon="plusCircle" iconTint="var(--acc)" title={t('Create passkey profile')} subtitle={t('Keeps your data safe and separate per person.')} accessory="chevron" onClick={registerHere} />
<Row icon="fingerprint" iconTint="var(--blue)" title={t('Sign in with passkey')} accessory="chevron" onClick={passkeySignIn} />
+ {/* The Login screen offers both of these; a guest who skipped it had no way to either from here. */}
+ {pwOn && <Row icon="plusCircle" iconTint="var(--orange)" title={t('Create profile with a password')} accessory="chevron" onClick={openPasswordRegister} />}
{pwOn && <Row icon="key" iconTint="var(--orange)" title={t('Sign in with password')} accessory="chevron" onClick={() => openPasswordSignIn()} />}
+ <Row icon="qr" iconTint="var(--blue)" title={t('Use a code from your other device')} accessory="chevron" onClick={openDeviceLinkRedeem} />
<KeptChangesRows />
</> : pwOn ? <>
{/* No passkeys in this browser (plain http on a LAN address, say): a password is the way in. */}
diff --git a/frontend/src/views/Settings.password.test.jsx b/frontend/src/views/Settings.password.test.jsx
index e2c8185ee..25fb107d1 100644
--- a/frontend/src/views/Settings.password.test.jsx
+++ b/frontend/src/views/Settings.password.test.jsx
@@ -107,6 +107,27 @@ describe('Settings with password sign-in', () => {
expect(titles(section(off, 'Account'))).toEqual(['Passkeys not supported in this browser.'])
})
+ // A guest who chose "Continue without account" in a browser that can make passkeys only had
+ // the passkey ways in here: no password profile, no code from another device.
+ it('a guest in a passkey browser can also create a password profile or use a code from another device', () => {
+ mocks.user = null
+ mocks.sync = null
+ const page = mount(<Settings page="account" />)
+ const account = section(page, 'Account')
+ expect(titles(account)).toEqual(['Create passkey profile', 'Sign in with passkey', 'Create profile with a password', 'Sign in with password', 'Use a code from your other device'])
+ act(() => rowByTitle(account, 'Create profile with a password').click())
+ const sheet = mount(mocks.sheets.at(-1).render(() => {}))
+ expect(sheet.querySelector('h3').textContent).toBe('Create your profile')
+ expect(sheet.querySelector('input[name="new-password"]')).toBeTruthy()
+ act(() => rowByTitle(account, 'Use a code from your other device').click())
+ const code = mount(mocks.sheets.at(-1).render(() => {}))
+ expect(code.querySelector('h3').textContent).toBe('Add this device')
+
+ mocks.config = null
+ const off = mount(<Settings page="account" />)
+ expect(titles(section(off, 'Account'))).toEqual(['Create passkey profile', 'Sign in with passkey', 'Use a code from your other device'])
+ })
+
it('"Sign in" after the server ended the session asks which way; the passkey is one tap on it', async () => {
mocks.sync = { status: 'auth', offline: false, pending: true, auth: true, lastError: { status: 401 }, lastSynced: 0, server: null }
const page = mount(<Settings page="account" />)