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: no "confirm with your passkey" on a password profile that has no passkey (#118)

Duarte Santos80874003573c
diff --git a/frontend/src/components/PasswordAuth.jsx b/frontend/src/components/PasswordAuth.jsx
index 7f736cdbc..3d27d301f 100644
--- a/frontend/src/components/PasswordAuth.jsx
+++ b/frontend/src/components/PasswordAuth.jsx
@@ -202,7 +202,7 @@ export function PasswordRow() {
useEffect(() => { load() }, [])
if (!st) return null
// Nothing here could set a first password without a passkey ceremony.
- if (!st.set && !webauthnOK()) return null
+ if (!st.set && (!webauthnOK() || !st.passkeys)) return null
const blocked = !st.set && st.nameTaken
const subtitle = blocked ? t('Another profile already signs in with this name.')
: st.set ? t('Set · sign in as “{0}”', st.name)
@@ -264,7 +264,7 @@ export function PasswordSheet({ status, close, done }) {
<div style={{ height: 12 }} />
<Button type="submit" variant="primary" disabled={busy}>{status.set ? t('Save') : t('Confirm with passkey & save')}</Button>
</form>
- {status.set && webauthnOK() && <>
+ {status.set && status.passkeys > 0 && webauthnOK() && <>
<div style={{ height: 8 }} />
<Button type="button" variant="ghost" className="dim" disabled={busy} onClick={() => save(true)}>{t('Forgot it? Confirm with your passkey instead')}</Button>
</>}
diff --git a/frontend/src/components/PasswordAuth.test.jsx b/frontend/src/components/PasswordAuth.test.jsx
index 7d587ef24..642963998 100644
--- a/frontend/src/components/PasswordAuth.test.jsx
+++ b/frontend/src/components/PasswordAuth.test.jsx
@@ -243,8 +243,10 @@ describe('Settings → Password', () => {
expect(mocks.passkeyAssertion).not.toHaveBeenCalled()
expect(alertText(host)).toBe('Your current password is not right.')
expect(close).not.toHaveBeenCalled()
- // No passkey on this profile: the password is its only way in, so there is no "Remove".
+ // No passkey on this profile: the password is its only way in, so there is no "Remove" —
+ // and no "confirm with your passkey" either.
expect(button(host, 'Remove password')).toBeUndefined()
+ expect(button(host, 'Forgot it? Confirm with your passkey instead')).toBeUndefined()
})
it('removing asks first and then deletes; only offered while a passkey remains', async () => {