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
Password sign-in: the sign-in field takes a name or an e-mail, and Settings gets a sign-in e-mail row
Duarte Santos683ac0c0cde9
diff --git a/frontend/src/components/Icon.jsx b/frontend/src/components/Icon.jsxindex 51f7e97b0..0df67c1c6 100644--- a/frontend/src/components/Icon.jsx+++ b/frontend/src/components/Icon.jsx@@ -100,6 +100,7 @@ const P = {sun: <><circle cx="12" cy="12" r="4.4" /><path d="M12 3.6v2M12 18.4v2M20.4 12h-2M5.6 12h-2M17.94 6.06l-1.42 1.42M7.48 16.52l-1.42 1.42M17.94 17.94l-1.42-1.42M7.48 7.48 6.06 6.06" /></>,key: <><circle cx="8.2" cy="15.8" r="3.8" /><path d="m10.9 13.1 8-8M16.6 7.4l2 2M14.6 9.4l2 2" /></>,lock: <><rect x="5" y="10.4" width="14" height="10" rx="2.8" /><path d="M8.4 10.4V7.8a3.6 3.6 0 0 1 7.2 0v2.6" /></>,+ envelope: <><rect x="3.5" y="5.5" width="17" height="13" rx="2.5" /><path d="m4.5 7 7.5 6 7.5-6" /></>,// the connection to the server (components/SyncBanner.jsx): there, and not therecloud: <path d="M7 18.2h10.2a3.6 3.6 0 0 0 .1-7.2 5.4 5.4 0 0 0-10.4.6A3.3 3.3 0 0 0 7 18.2Z" />,cloudSlash: <><path d="M7 18.2h10.2a3.6 3.6 0 0 0 .1-7.2 5.4 5.4 0 0 0-10.4.6A3.3 3.3 0 0 0 7 18.2Z" /><path d="M4 3.6l16 16.8" /></>,diff --git a/frontend/src/components/PasswordAuth.jsx b/frontend/src/components/PasswordAuth.jsxindex ea49a397d..7498dab72 100644--- a/frontend/src/components/PasswordAuth.jsx+++ b/frontend/src/components/PasswordAuth.jsx@@ -3,7 +3,8 @@// signing in, redeeming the one-time code an admin hands out, creating a profile with a// password, and the Settings row that sets, changes or removes one — and the "confirm it is you"// step (ProveOwner) that Settings asks for before a way in is added or removed, where the-// password is one of the two answers. Passkeys stay the default wherever this appears; the rules+// password is one of the two answers — and the optional sign-in e-mail a profile may type there+// instead of its name (EmailRow). Passkeys stay the default wherever this appears; the rules// themselves are the server's (api/password.js and the password block in api/server.js), this// only words them.import { useEffect, useRef, useState } from 'react'@@ -19,6 +20,9 @@ import { Row, Button } from './ui.jsx'// answered without a round trip. The server still decides.export const MIN_PASSWORD = 10export const passwordOn = config => !!config?.password_login+// The loosest look at an address that still catches a name typed in the wrong field; the server+// (normalizeEmail in api/password.js) decides.+export const looksLikeEmail = s => s.length <= 254 && /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(s)const ui = () => useUI.getState()const toast = m => ui().toast(m)@@ -38,11 +42,13 @@ export function passwordError(e) {const code = e?.data?.codeif (e?.status === 429 || code === 'locked') return t('Too many attempts — try again {0}.', fmtIn(e?.data?.retryAfter || 60))switch (code) {- case 'bad-credentials': return t('Wrong name or password.')+ case 'bad-credentials': return t('Wrong name, e-mail or password.')case 'too-short': return t('Use at least {0} characters.', MIN_PASSWORD)case 'too-long': return t('That password is too long.')case 'too-common': return t('That password is too easy to guess — try a longer one, or a few unrelated words.')case 'name-taken': return t('Another profile already signs in with this name.')+ case 'email-invalid': return t('That is not an e-mail address.')+ case 'email-taken': return t('Another profile already uses this e-mail address.')case 'invite': return t('That invite code is not valid.')case 'current-required': case 'current-wrong': return t('Your current password is not right.')case 'passkey': case 'passkey-required': return t('Your passkey could not be confirmed.')@@ -69,7 +75,7 @@ async function signedIn(u, close) {const field = { autoCapitalize: 'none', autoCorrect: 'off', spellCheck: false }const codeStyle = { letterSpacing: '.14em', fontWeight: 600, textAlign: 'center' }-/* Sign in with name and password, or — one tap away — redeem a reset code from the admin, which+/* Sign in with name (or the profile's sign-in e-mail) and password, or — one tap away — redeem a reset code from the admin, whichsets a new password and signs in. `onPasskey`, when given, offers the passkey instead. Theinputs carry the autocomplete names password managers look for, inside a real form. */export function PasswordSignInSheet({ close, onPasskey }) {@@ -88,7 +94,7 @@ export function PasswordSignInSheet({ close, onPasskey }) {ev.preventDefault()if (busy) returnconst n = name.trim()- const bad = !n ? t('Enter a name')+ const bad = !n ? t('Enter your name or e-mail.'): !reset && !pw ? t('Enter your password.'): reset && !code.trim() ? t('Enter the reset code.'): reset && length(next) < MIN_PASSWORD ? t('Use at least {0} characters.', MIN_PASSWORD)@@ -105,9 +111,11 @@ export function PasswordSignInSheet({ close, onPasskey }) {<h3>{reset ? t('Reset your password') : t('Sign in with password')}</h3><div className="muted small" style={{ marginBottom: 14 }}>{reset? t('Enter the code your admin gave you and choose a new password. It signs you out everywhere else.')- : t('Use your profile name and the password you set for it.')}</div>+ : t('Use your profile name — or the e-mail you added to it — and your password.')}</div><form onSubmit={submit} noValidate>- <input ref={nameRef} className="input" name="username" autoComplete="username" placeholder={t('Your name')} maxLength={40}+ {/* One field for both: the server looks an entry with an "@" up as an e-mail first. Not+ type="email", which would refuse a plain name. */}+ <input ref={nameRef} className="input" name="username" autoComplete="username" placeholder={t('Name or e-mail')} maxLength={254}value={name} onChange={e => setName(e.target.value)} {...field} /><div style={{ height: 10 }} />{reset ? <>@@ -140,6 +148,7 @@ export const openPasswordSignIn = onPasskey => ui().openSheet(close => <Password/* The password half of creating a profile. Name and invite code are the caller's state, soswitching between passkey and password on the sign-up sheet keeps what was typed. */export function PasswordRegisterForm({ close, inviteOnly, name, setName, code, setCode }) {+ const [email, setEmail] = useState('')const [pw, setPw] = useState('')const [again, setAgain] = useState('')const [busy, setBusy] = useState(false)@@ -148,7 +157,9 @@ export function PasswordRegisterForm({ close, inviteOnly, name, setName, code, sev.preventDefault()if (busy) returnconst n = name.trim()+ const mail = email.trim()const bad = !n ? t('Enter a name')+ : mail && !looksLikeEmail(mail) ? t('That is not an e-mail address.'): inviteOnly && !code.trim() ? t('An invite code is required'): length(pw) < MIN_PASSWORD ? t('Use at least {0} characters.', MIN_PASSWORD): pw !== again ? t('The two passwords are not the same.')@@ -156,7 +167,7 @@ export function PasswordRegisterForm({ close, inviteOnly, name, setName, code, sif (bad) { setErr(bad); return }setBusy(true); setErr(null)try {- const u = await passwordRegister(n, pw, code.trim())+ const u = await passwordRegister(n, pw, code.trim(), mail)const st = useStore.getState()st.setUser(u); close()if (hasData(useStore.getState().S)) { await st.pushState(); toast(t('Profile created — data from this device moved into it')) }@@ -167,6 +178,10 @@ export function PasswordRegisterForm({ close, inviteOnly, name, setName, code, sreturn <form onSubmit={submit} noValidate><input className="input" name="username" autoComplete="username" placeholder={t('Your name')} maxLength={40}value={name} onChange={e => setName(e.target.value)} {...field} />+ <div style={{ height: 10 }} />+ <input className="input" type="email" name="email" autoComplete="email" inputMode="email" placeholder={t('E-mail (optional)')} maxLength={254}+ value={email} onChange={e => setEmail(e.target.value)} {...field} />+ <div className="dim small" style={{ marginTop: 6 }}>{t('Lets you sign in with it instead of your name. Nothing is ever sent to it.')}</div>{inviteOnly && <><div style={{ height: 10 }} /><input className="input" placeholder={t('Invite code')} maxLength={40} value={code}@@ -299,8 +314,11 @@ export function PasswordRow({ version = 0 }) {const subtitle = blocked ? t('Another profile already signs in with this name.'): st.set ? t('Set · sign in as “{0}”', st.name): t('Not set — lets you sign in where passkeys do not work.')- return <Row icon="key" iconTint="var(--orange)" title={t('Password')} subtitle={subtitle} accessory={blocked ? 'none' : 'chevron'}- onClick={blocked ? undefined : () => ui().openSheet(close => <PasswordSheet status={st} close={close} done={load} />)} />+ return <>+ <Row icon="key" iconTint="var(--orange)" title={t('Password')} subtitle={subtitle} accessory={blocked ? 'none' : 'chevron'}+ onClick={blocked ? undefined : () => ui().openSheet(close => <PasswordSheet status={st} close={close} done={load} />)} />+ <EmailRow status={st} done={load} />+ </>}export function PasswordSheet({ status, close, done }) {@@ -380,3 +398,82 @@ function RemovePasswordSheet({ status, close, done }) {<Button type="button" variant="ghost" className="dim" onClick={close}>{t('Cancel')}</Button></>}++/* Settings → Account → Sign-in e-mail, right under the password (and shown on the same terms:+ only while the instance takes passwords, and only where something here can confirm it is the+ owner). An address typed at "Sign in with password" instead of the profile name. Nothing is+ ever sent to it — there is no mail server behind openGym — so it is not verified either, and a+ forgotten password is still reset by the admin's code. Setting, changing and removing it ask+ the proof a password does (ProveOwner): a copied session must not choose how the owner signs+ in. `status` is GET /api/account/password, whose `email` only the owner ever gets. */+export function EmailRow({ status, done }) {+ const subtitle = status.email ? t('Sign in with “{0}” instead of your name', status.email)+ : t('Not set — sign in with an e-mail instead of your name.')+ return <Row icon="envelope" iconTint="var(--blue)" title={t('Sign-in e-mail')} subtitle={subtitle} accessory="chevron"+ onClick={() => ui().openSheet(close => <EmailSheet status={status} close={close} done={done} />)} />+}++// Two steps: the address first, checked here before any passkey prompt opens, then the proof,+// which carries the save. An address in use is only refused after the proof (the server's rule,+// so that asking costs something), and is said on the proof step.+export function EmailSheet({ status, close, done }) {+ const [email, setEmail] = useState(status.email || '')+ const [step, setStep] = useState('edit') // 'edit' | 'confirm'+ const [err, setErr] = useState(null)+ const clean = email.trim()+ const next = ev => {+ ev.preventDefault()+ const bad = !clean || !looksLikeEmail(clean) ? t('That is not an e-mail address.')+ : clean.toLowerCase() === status.email ? t('That is already your sign-in e-mail.')+ : null+ if (bad) { setErr(bad); return }+ setErr(null); setStep('confirm')+ }+ const save = async proof => {+ await api('/api/account/email', { method: 'POST', body: JSON.stringify({ email: clean, ...proof }) })+ close(); done()+ toast(t('E-mail saved'))+ }+ const remove = () => ui().openSheet(c => <RemoveEmailSheet status={status} close={c} done={() => { close(); done() }} />)+ return <>+ <h3>{status.email ? t('Change sign-in e-mail') : t('Add a sign-in e-mail')}</h3>+ <div className="muted small" style={{ marginBottom: 14 }}>+ {t('Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.')}+ </div>+ {step === 'edit' ? <>+ <form onSubmit={next} noValidate>+ <input className="input" type="email" name="email" autoComplete="email" inputMode="email" placeholder={t('E-mail address')} maxLength={254}+ value={email} onChange={e => setEmail(e.target.value)} {...field} />+ {err && <div className="small" role="alert" style={errStyle}>{err}</div>}+ <div style={{ height: 12 }} />+ <Button type="submit" variant="primary">{t('Continue')}</Button>+ </form>+ {status.email && <>+ <div style={{ height: 8 }} />+ <button type="button" className="btn danger" onClick={remove}>{t('Remove e-mail')}</button>+ </>}+ </> : <>+ <div className="small" style={{ marginBottom: 6, fontWeight: 600, overflowWrap: 'anywhere' }}>{clean}</div>+ <div className="dim small" style={{ marginBottom: 14 }}>{t('First confirm that it is you.')}</div>+ <ProveOwner passkey={status.passkeys > 0} password={!!status.set} submitText={t('Save')} onProof={save} />+ <div style={{ height: 8 }} />+ <Button type="button" variant="ghost" className="dim" onClick={() => setStep('edit')}>{t('Back')}</Button>+ </>}+ </>+}++function RemoveEmailSheet({ status, close, done }) {+ const remove = async proof => {+ await api('/api/account/email', { method: 'DELETE', body: JSON.stringify(proof) })+ close(); done()+ toast(t('E-mail removed'))+ }+ return <>+ <h3>{t('Remove your sign-in e-mail?')}</h3>+ <div className="muted small" style={{ marginBottom: 6 }}>{t('Afterwards you sign in with your profile name only.')}</div>+ <div className="dim small" style={{ marginBottom: 14 }}>{t('First confirm that it is you.')}</div>+ <ProveOwner passkey={status.passkeys > 0} password={!!status.set} danger submitText={t('Remove')} onProof={remove} />+ <div style={{ height: 8 }} />+ <Button type="button" variant="ghost" className="dim" onClick={close}>{t('Cancel')}</Button>+ </>+}diff --git a/frontend/src/components/PasswordAuth.test.jsx b/frontend/src/components/PasswordAuth.test.jsxindex 0ccf5e0ca..a7f8c21e6 100644--- a/frontend/src/components/PasswordAuth.test.jsx+++ b/frontend/src/components/PasswordAuth.test.jsx@@ -2,7 +2,7 @@import React, { act } from 'react'import { createRoot } from 'react-dom/client'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'-import { passwordError, PasswordSignInSheet, PasswordRegisterForm, PasswordRow, PasswordSheet } from './PasswordAuth.jsx'+import { passwordError, PasswordSignInSheet, PasswordRegisterForm, PasswordRow, PasswordSheet, EmailSheet } from './PasswordAuth.jsx'globalThis.IS_REACT_ACT_ENVIRONMENT = true@@ -91,7 +91,9 @@ afterEach(() => { act(() => { mounted.splice(0).forEach(({ root, host }) => { rodescribe('passwordError', () => {it('words each server code in the UI language, and a pause with how long it lasts', () => {- expect(passwordError(fail(401, { code: 'bad-credentials' }))).toBe('Wrong name or password.')+ expect(passwordError(fail(401, { code: 'bad-credentials' }))).toBe('Wrong name, e-mail or password.')+ expect(passwordError(fail(400, { code: 'email-invalid' }))).toBe('That is not an e-mail address.')+ expect(passwordError(fail(409, { code: 'email-taken' }))).toBe('Another profile already uses this e-mail address.')expect(passwordError(fail(400, { code: 'too-common' }))).toMatch(/too easy to guess/)expect(passwordError(fail(400, { code: 'too-short' }))).toBe('Use at least 10 characters.')expect(passwordError(fail(409, { code: 'last-way-in' }))).toMatch(/only way into your profile/)@@ -107,7 +109,7 @@ describe('PasswordSignInSheet', () => {mocks.passwordLogin.mockResolvedValue({ id: 'u1', name: 'Ana' })const close = vi.fn()const host = mount(<PasswordSignInSheet close={close} />)- const name = byPlaceholder(host, 'Your name')+ const name = byPlaceholder(host, 'Name or e-mail')const pw = byPlaceholder(host, 'Password')// What password managers look for.expect(name.getAttribute('autocomplete')).toBe('username')@@ -126,9 +128,9 @@ describe('PasswordSignInSheet', () => {mocks.passwordLogin.mockRejectedValue(fail(401, { error: 'wrong name or password', code: 'bad-credentials' }))const close = vi.fn()const host = mount(<PasswordSignInSheet close={close} />)- type(byPlaceholder(host, 'Your name'), 'Ana'); type(byPlaceholder(host, 'Password'), 'nope nope nope')+ type(byPlaceholder(host, 'Name or e-mail'), 'Ana'); type(byPlaceholder(host, 'Password'), 'nope nope nope')await submit(host)- expect(alertText(host)).toBe('Wrong name or password.')+ expect(alertText(host)).toBe('Wrong name, e-mail or password.')expect(mocks.setUser).not.toHaveBeenCalled()expect(close).not.toHaveBeenCalled()})@@ -138,7 +140,7 @@ describe('PasswordSignInSheet', () => {const host = mount(<PasswordSignInSheet close={() => {}} />)act(() => button(host, 'Have a reset code from your admin?').click())expect(host.querySelector('h3').textContent).toBe('Reset your password')- type(byPlaceholder(host, 'Your name'), 'Ana')+ type(byPlaceholder(host, 'Name or e-mail'), 'Ana')type(byPlaceholder(host, 'Reset code'), 'k7wq-2mzp-4hxa')type(byPlaceholder(host, 'New password'), 'short')await submit(host)@@ -158,6 +160,36 @@ describe('PasswordSignInSheet', () => {expect(mocks.setUser).toHaveBeenCalled()})+ it('the one field takes an e-mail as well as a name, long enough for either, and sends it as typed', async () => {+ mocks.passwordLogin.mockResolvedValue({ id: 'u1', name: 'Ana' })+ const host = mount(<PasswordSignInSheet close={() => {}} />)+ expect(host.textContent).toContain('Use your profile name — or the e-mail you added to it — and your password.')+ const field = byPlaceholder(host, 'Name or e-mail')+ // Not type="email": that would refuse a plain name.+ expect(field.type).toBe('text')+ expect(field.getAttribute('autocomplete')).toBe('username')+ expect(+field.getAttribute('maxlength')).toBe(254)+ await submit(host)+ expect(alertText(host)).toBe('Enter your name or e-mail.')+ expect(mocks.passwordLogin).not.toHaveBeenCalled()+ type(field, ' [email protected] '); type(byPlaceholder(host, 'Password'), 'correct horse battery')+ await submit(host)+ expect(mocks.passwordLogin).toHaveBeenCalledWith('[email protected]', 'correct horse battery')+ expect(mocks.setUser).toHaveBeenCalledWith({ id: 'u1', name: 'Ana' })+ })++ it('a reset code is redeemed with the e-mail too', async () => {+ mocks.passwordResetRedeem.mockResolvedValue({ id: 'u1', name: 'Ana' })+ const host = mount(<PasswordSignInSheet close={() => {}} />)+ act(() => button(host, 'Have a reset code from your admin?').click())+ type(byPlaceholder(host, 'Name or e-mail'), '[email protected]')+ type(byPlaceholder(host, 'Reset code'), 'K7WQ-2MZP-4HXA')+ type(byPlaceholder(host, 'New password'), 'a brand new passphrase')+ type(byPlaceholder(host, 'Repeat the password'), 'a brand new passphrase')+ await submit(host)+ expect(mocks.passwordResetRedeem).toHaveBeenCalledWith('[email protected]', 'K7WQ-2MZP-4HXA', 'a brand new passphrase')+ })+it('offers the passkey only when the caller hands one over and this browser can make one', () => {const onPasskey = vi.fn()const host = mount(<PasswordSignInSheet close={() => {}} onPasskey={onPasskey} />)@@ -191,12 +223,35 @@ describe('PasswordRegisterForm', () => {expect(mocks.passwordRegister).not.toHaveBeenCalled()type(byPlaceholder(host, 'Repeat the password'), 'correct horse battery')await submit(host)- expect(mocks.passwordRegister).toHaveBeenCalledWith('Cleo', 'correct horse battery', 'ABC123')+ expect(mocks.passwordRegister).toHaveBeenCalledWith('Cleo', 'correct horse battery', 'ABC123', '')expect(mocks.setUser).toHaveBeenCalledWith({ id: 'u9', name: 'Cleo' })expect(mocks.pullState).toHaveBeenCalled()expect(mocks.toast).toHaveBeenCalledWith('Welcome, Cleo')})+ it('takes an optional e-mail, checks its shape here, and says when another profile has it', async () => {+ mocks.passwordRegister.mockResolvedValue({ id: 'u9', name: 'Cleo' })+ const host = mount(<Harness />)+ const mail = byPlaceholder(host, 'E-mail (optional)')+ expect(mail.type).toBe('email')+ expect(mail.getAttribute('autocomplete')).toBe('email')+ expect(host.textContent).toContain('Lets you sign in with it instead of your name. Nothing is ever sent to it.')+ type(byPlaceholder(host, 'Your name'), 'Cleo')+ type(mail, 'cleo at example')+ type(byPlaceholder(host, 'Password'), 'correct horse battery')+ type(byPlaceholder(host, 'Repeat the password'), 'correct horse battery')+ await submit(host)+ expect(alertText(host)).toBe('That is not an e-mail address.')+ expect(mocks.passwordRegister).not.toHaveBeenCalled()+ mocks.passwordRegister.mockRejectedValueOnce(fail(409, { code: 'email-taken' }))+ type(mail, ' [email protected] ')+ await submit(host)+ expect(mocks.passwordRegister).toHaveBeenLastCalledWith('Cleo', 'correct horse battery', '', '[email protected]')+ expect(alertText(host)).toBe('Another profile already uses this e-mail address.')+ await submit(host)+ expect(mocks.setUser).toHaveBeenCalledWith({ id: 'u9', name: 'Cleo' })+ })+it('a name already taken by a password profile is said in words', async () => {mocks.passwordRegister.mockRejectedValue(fail(409, { code: 'name-taken' }))const host = mount(<Harness />)@@ -226,6 +281,23 @@ describe('Settings → Password', () => {expect(none.textContent).toBe('')})+ it('the sign-in e-mail sits right under the password, with the address when there is one', async () => {+ const titles = host => [...host.querySelectorAll('.lrow-t')].map(e => e.textContent)+ const subs = host => [...host.querySelectorAll('.lrow-s')].map(e => e.textContent)+ mocks.answers['GET /api/account/password'] = { set: true, setAt: null, passkeys: 1, name: 'Ana', nameTaken: false, email: '[email protected]' }+ const host = mount(<PasswordRow />)+ await settle()+ expect(titles(host)).toEqual(['Password', 'Sign-in e-mail'])+ expect(subs(host)[1]).toBe('Sign in with “[email protected]” instead of your name')+ mocks.answers['GET /api/account/password'] = { set: true, setAt: null, passkeys: 0, name: 'Ana', nameTaken: false, email: null }+ const unset = mount(<PasswordRow />)+ await settle()+ expect(subs(unset)[1]).toBe('Not set — sign in with an e-mail instead of your name.')+ act(() => [...unset.querySelectorAll('.lrow')].find(r => r.textContent.includes('Sign-in e-mail')).click())+ const sheet = mount(mocks.sheets.at(-1).render(() => {}))+ expect(sheet.querySelector('h3').textContent).toBe('Add a sign-in e-mail')+ })+it('a first password is confirmed with the passkey and sent with its assertion', async () => {const done = vi.fn(), close = vi.fn()const host = mount(<PasswordSheet status={{ set: false, passkeys: 1, name: 'Ana' }} close={close} done={done} />)@@ -360,3 +432,87 @@ describe('Settings → Password → Remove', () => {expect(button(host, 'Remove password')).toBeUndefined()})})++/* Settings → Sign-in e-mail: the address first, checked here, then the owner's proof (proveOwner in+ api/server.js) — the password or a passkey of this profile — which carries the save. Removing+ takes the same proof. Nothing is sent before the proof. */+describe('Settings → Sign-in e-mail', () => {+ const posts = () => mocks.calls.filter(c => c.path === '/api/account/email')+ function open(status = { set: true, passkeys: 1, name: 'Ana', email: null }) {+ const close = vi.fn(), done = vi.fn()+ return { host: mount(<EmailSheet status={status} close={close} done={done} />), close, done }+ }++ it('checks the address before asking for proof, then saves it with the password as proof', async () => {+ mocks.answers['POST /api/account/email'] = { ok: true, email: '[email protected]' }+ const { host, close, done } = open()+ const input = byPlaceholder(host, 'E-mail address')+ expect(input.type).toBe('email')+ expect(input.getAttribute('autocomplete')).toBe('email')+ expect(host.textContent).toContain('Nothing is ever sent to it')+ type(input, 'not an address')+ await submit(host)+ expect(alertText(host)).toBe('That is not an e-mail address.')+ expect(byPlaceholder(host, 'Current password')).toBeNull()+ type(byPlaceholder(host, 'E-mail address'), ' [email protected] ')+ await submit(host)+ // The proof step: nothing sent yet.+ expect(host.textContent).toContain('[email protected]')+ expect(host.textContent).toContain('First confirm that it is you.')+ expect(posts()).toEqual([])+ type(byPlaceholder(host, 'Current password'), 'correct horse battery')+ await click(host, 'Save')+ expect(posts()).toEqual([{ path: '/api/account/email', method: 'POST', body: { email: '[email protected]', current: 'correct horse battery' } }])+ expect(close).toHaveBeenCalled()+ expect(done).toHaveBeenCalled()+ expect(mocks.toast).toHaveBeenCalledWith('E-mail saved')+ })++ it('or with a passkey; an address another profile uses is said on the proof step', async () => {+ mocks.answers['POST /api/account/email'] = fail(409, { code: 'email-taken' })+ const { host, close } = open({ set: false, passkeys: 1, name: 'Ana', email: null })+ type(byPlaceholder(host, 'E-mail address'), '[email protected]')+ await submit(host)+ // No password on this profile: the passkey is the only proof offered.+ expect(byPlaceholder(host, 'Current password')).toBeNull()+ await click(host, 'Confirm with a passkey')+ expect(mocks.passkeyAssertion).toHaveBeenCalledTimes(1)+ expect(posts()).toEqual([{ path: '/api/account/email', method: 'POST', body: { email: '[email protected]', cid: 'c1', credential: { id: 'k1' } } }])+ expect(alertText(host)).toBe('Another profile already uses this e-mail address.')+ expect(close).not.toHaveBeenCalled()+ await click(host, 'Back')+ expect(byPlaceholder(host, 'E-mail address').value).toBe('[email protected]')+ })++ it('changing to the address it already has is caught here', async () => {+ const { host } = open({ set: true, passkeys: 1, name: 'Ana', email: '[email protected]' })+ expect(host.querySelector('h3').textContent).toBe('Change sign-in e-mail')+ expect(byPlaceholder(host, 'E-mail address').value).toBe('[email protected]')+ type(byPlaceholder(host, 'E-mail address'), '[email protected]')+ await submit(host)+ expect(alertText(host)).toBe('That is already your sign-in e-mail.')+ })++ it('removing asks for the same proof, then removes', async () => {+ mocks.answers['DELETE /api/account/email'] = { ok: true, email: null }+ const { host, close, done } = open({ set: true, passkeys: 1, name: 'Ana', email: '[email protected]' })+ act(() => button(host, 'Remove e-mail').click())+ const removeClose = vi.fn()+ const sheet = mount(mocks.sheets.at(-1).render(removeClose))+ expect(sheet.querySelector('h3').textContent).toBe('Remove your sign-in e-mail?')+ expect(sheet.textContent).toContain('Afterwards you sign in with your profile name only.')+ expect(posts()).toEqual([])+ type(byPlaceholder(sheet, 'Current password'), 'correct horse battery')+ await click(sheet, 'Remove')+ expect(posts()).toEqual([{ path: '/api/account/email', method: 'DELETE', body: { current: 'correct horse battery' } }])+ expect(removeClose).toHaveBeenCalled()+ expect(close).toHaveBeenCalled()+ expect(done).toHaveBeenCalled()+ expect(mocks.toast).toHaveBeenCalledWith('E-mail removed')+ })++ it('no remove button while there is no address', () => {+ const { host } = open()+ expect(button(host, 'Remove e-mail')).toBeUndefined()+ })+})diff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.jsindex 4342bc5ae..06f2390b4 100644--- a/frontend/src/lib/api.js+++ b/frontend/src/lib/api.js@@ -283,11 +283,16 @@ export async function createPasskey(options) {// these answers with the same session cookie a passkey sign-in sets, so callers treat the user// they return exactly alike.const post = (path, body) => api(path, { method: 'POST', body: JSON.stringify(body) })+// `name` is whatever was typed in "Name or e-mail": it goes in the original `name` field, which+// the server matches against the profile's sign-in e-mail when it holds an "@" and against the+// name otherwise — so the app and a server a version apart still understand each other.export async function passwordLogin(name, password) {return (await post('/api/login/password', { name, password })).user}-export async function passwordRegister(name, password, code) {- return (await post('/api/register/password', { name, password, code: code || '' })).user+// `email` is optional, and sent only when there is one: a server from before the field would+// otherwise ignore it without a word, which is the same thing.+export async function passwordRegister(name, password, code, email) {+ return (await post('/api/register/password', { name, password, code: code || '', ...(email ? { email } : {}) })).user}export async function passwordResetRedeem(name, code, next) {return (await post('/api/login/password-reset', { name, code, next })).userdiff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex 897a1bc63..3ba4e1ebc 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -60,5 +60,10 @@ describe('Brazilian Portuguese locale', () => {expect(ptBR.soleus).toBe('sóleo')expect(ptBR.Unpair).toBe('Desvincular')expect(ptBR['Choose starter plan']).toBe('Escolha um plano inicial')+ // The sign-in e-mail's strings are overridden, not inherited: pt-PT says palavra-passe and «».+ expect(ptBR['Wrong name, e-mail or password.']).toBe('Nome, e-mail ou senha incorretos.')+ expect(ptBR['Sign-in e-mail']).toBe('E-mail de login')+ for (const key of ['Name or e-mail', 'Sign in with “{0}” instead of your name', 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.'])+ expect(key in PT_BR_OVERRIDES, key).toBe(true)})})diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 7f2357780..cab2a0a0f 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -1515,7 +1515,6 @@ export default {'Passkey': 'مفتاح المرور','Passkeys use {0}. A password works too, where passkeys do not.': 'تستخدم مفاتيح المرور {0}. وتعمل كلمة المرور أيضًا حيث لا تعمل مفاتيح المرور.','This browser doesn\'t support passkeys — sign in with your name and password instead.': 'لا يدعم هذا المتصفح مفاتيح المرور — سجّل الدخول باسمك وكلمة المرور بدلًا من ذلك.',- 'Use your profile name and the password you set for it.': 'استخدم اسم ملفك الشخصي وكلمة المرور التي عيّنتها له.','Have a reset code from your admin?': 'هل لديك رمز إعادة تعيين من المسؤول؟','Reset your password': 'إعادة تعيين كلمة المرور','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'أدخل الرمز الذي أعطاك إياه المسؤول واختر كلمة مرور جديدة. سيُسجَّل خروجك من كل مكان آخر.',@@ -1542,7 +1541,27 @@ export default {'Remove your password?': 'إزالة كلمة المرور؟','Only your passkeys sign in to this profile afterwards.': 'بعد ذلك، لا يمكن الدخول إلى هذا الملف الشخصي إلا بمفاتيح المرور.','Password removed': 'تمت إزالة كلمة المرور',- 'Wrong name or password.': 'الاسم أو كلمة المرور غير صحيحة.',+ 'Wrong name, e-mail or password.': 'الاسم أو البريد الإلكتروني أو كلمة المرور غير صحيحة.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'استخدم اسم ملفك الشخصي — أو البريد الإلكتروني الذي أضفته إليه — وكلمة المرور.',+ 'Name or e-mail': 'الاسم أو البريد الإلكتروني',+ 'Enter your name or e-mail.': 'أدخل اسمك أو بريدك الإلكتروني.',+ 'E-mail (optional)': 'البريد الإلكتروني (اختياري)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'يتيح لك تسجيل الدخول به بدلًا من اسمك. لا يُرسَل إليه أي شيء أبدًا.',+ 'That is not an e-mail address.': 'هذا ليس عنوان بريد إلكتروني.',+ 'Another profile already uses this e-mail address.': 'هناك ملف شخصي آخر يستخدم عنوان البريد الإلكتروني هذا.',+ 'Sign-in e-mail': 'بريد تسجيل الدخول',+ 'Sign in with “{0}” instead of your name': 'سجّل الدخول بـ «{0}» بدلًا من اسمك',+ 'Not set — sign in with an e-mail instead of your name.': 'غير معيّن — سجّل الدخول ببريد إلكتروني بدلًا من اسمك.',+ 'Change sign-in e-mail': 'تغيير بريد تسجيل الدخول',+ 'Add a sign-in e-mail': 'إضافة بريد لتسجيل الدخول',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'اكتبه في «تسجيل الدخول بكلمة المرور» بدلًا من اسم ملفك الشخصي. لا يُرسَل إليه أي شيء أبدًا — وكلمة المرور المنسية يعيد المشرف تعيينها كما من قبل.',+ 'E-mail address': 'عنوان البريد الإلكتروني',+ 'That is already your sign-in e-mail.': 'هذا هو بريد تسجيل الدخول الخاص بك بالفعل.',+ 'E-mail saved': 'تم حفظ البريد الإلكتروني',+ 'Remove e-mail': 'إزالة البريد الإلكتروني',+ 'Remove your sign-in e-mail?': 'إزالة بريد تسجيل الدخول؟',+ 'Afterwards you sign in with your profile name only.': 'بعد ذلك تسجّل الدخول باسم ملفك الشخصي فقط.',+ 'E-mail removed': 'تمت إزالة البريد الإلكتروني','Too many attempts — try again {0}.': 'محاولات كثيرة جدًا — حاول مرة أخرى {0}.','Use at least {0} characters.': 'استخدم {0} أحرف على الأقل.','That password is too long.': 'كلمة المرور هذه طويلة جدًا.',diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex c20231a79..00a225f6d 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -313,7 +313,6 @@ export default {'Passkey': 'Passkey','Passkeys use {0}. A password works too, where passkeys do not.': 'Passkeys nutzen {0}. Wo sie nicht funktionieren, geht auch ein Passwort.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Dieser Browser unterstützt keine Passkeys — melde dich stattdessen mit Name und Passwort an.',- 'Use your profile name and the password you set for it.': 'Mit deinem Profilnamen und dem Passwort, das du dafür festgelegt hast.','Have a reset code from your admin?': 'Einen Reset-Code von deinem Admin bekommen?','Reset your password': 'Passwort zurücksetzen','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Gib den Code von deinem Admin ein und wähle ein neues Passwort. Überall sonst wirst du damit abgemeldet.',@@ -340,7 +339,27 @@ export default {'Remove your password?': 'Passwort entfernen?','Only your passkeys sign in to this profile afterwards.': 'Danach melden nur noch deine Passkeys dich bei diesem Profil an.','Password removed': 'Passwort entfernt',- 'Wrong name or password.': 'Name oder Passwort falsch.',+ 'Wrong name, e-mail or password.': 'Name, E-Mail oder Passwort falsch.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Mit deinem Profilnamen – oder der E-Mail, die du ihm hinzugefügt hast – und deinem Passwort.',+ 'Name or e-mail': 'Name oder E-Mail',+ 'Enter your name or e-mail.': 'Gib deinen Namen oder deine E-Mail ein.',+ 'E-mail (optional)': 'E-Mail (optional)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Damit kannst du dich statt mit deinem Namen anmelden. Es wird nie etwas an sie geschickt.',+ 'That is not an e-mail address.': 'Das ist keine E-Mail-Adresse.',+ 'Another profile already uses this e-mail address.': 'Ein anderes Profil verwendet diese E-Mail-Adresse schon.',+ 'Sign-in e-mail': 'Anmelde-E-Mail',+ 'Sign in with “{0}” instead of your name': 'Mit „{0}“ statt deinem Namen anmelden',+ 'Not set — sign in with an e-mail instead of your name.': 'Nicht festgelegt – melde dich mit einer E-Mail statt deinem Namen an.',+ 'Change sign-in e-mail': 'Anmelde-E-Mail ändern',+ 'Add a sign-in e-mail': 'Anmelde-E-Mail hinzufügen',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Gib sie bei „Mit Passwort anmelden“ statt deines Profilnamens ein. Es wird nie etwas an sie geschickt – ein vergessenes Passwort setzt weiterhin dein Admin zurück.',+ 'E-mail address': 'E-Mail-Adresse',+ 'That is already your sign-in e-mail.': 'Das ist schon deine Anmelde-E-Mail.',+ 'E-mail saved': 'E-Mail gespeichert',+ 'Remove e-mail': 'E-Mail entfernen',+ 'Remove your sign-in e-mail?': 'Anmelde-E-Mail entfernen?',+ 'Afterwards you sign in with your profile name only.': 'Danach meldest du dich nur noch mit deinem Profilnamen an.',+ 'E-mail removed': 'E-Mail entfernt','Too many attempts — try again {0}.': 'Zu viele Versuche — versuch es {0} noch einmal.','Use at least {0} characters.': 'Nimm mindestens {0} Zeichen.','That password is too long.': 'Dieses Passwort ist zu lang.',diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 0d2d98b63..f8a8f0c8f 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -299,7 +299,6 @@ export default {'Passkey': 'Passkey','Passkeys use {0}. A password works too, where passkeys do not.': 'Las passkeys usan {0}. Donde no funcionan, también sirve una contraseña.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Este navegador no admite passkeys — inicia sesión con tu nombre y tu contraseña.',- 'Use your profile name and the password you set for it.': 'Usa el nombre de tu perfil y la contraseña que le pusiste.','Have a reset code from your admin?': '¿Tienes un código de restablecimiento de tu administrador?','Reset your password': 'Restablecer tu contraseña','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Introduce el código que te dio tu administrador y elige una contraseña nueva. Se cierra tu sesión en todos los demás sitios.',@@ -326,7 +325,27 @@ export default {'Remove your password?': '¿Quitar tu contraseña?','Only your passkeys sign in to this profile afterwards.': 'Después, solo tus passkeys inician sesión en este perfil.','Password removed': 'Contraseña quitada',- 'Wrong name or password.': 'Nombre o contraseña incorrectos.',+ 'Wrong name, e-mail or password.': 'Nombre, correo o contraseña incorrectos.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Usa el nombre de tu perfil —o el correo que le añadiste— y tu contraseña.',+ 'Name or e-mail': 'Nombre o correo',+ 'Enter your name or e-mail.': 'Escribe tu nombre o tu correo.',+ 'E-mail (optional)': 'Correo (opcional)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Te permite iniciar sesión con él en lugar de con tu nombre. Nunca se le envía nada.',+ 'That is not an e-mail address.': 'Eso no es una dirección de correo.',+ 'Another profile already uses this e-mail address.': 'Otro perfil ya usa esta dirección de correo.',+ 'Sign-in e-mail': 'Correo de inicio de sesión',+ 'Sign in with “{0}” instead of your name': 'Inicia sesión con «{0}» en lugar de tu nombre',+ 'Not set — sign in with an e-mail instead of your name.': 'Sin configurar — inicia sesión con un correo en lugar de tu nombre.',+ 'Change sign-in e-mail': 'Cambiar correo de inicio de sesión',+ 'Add a sign-in e-mail': 'Añadir un correo de inicio de sesión',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Escríbelo en «Iniciar sesión con contraseña» en lugar del nombre de tu perfil. Nunca se le envía nada: una contraseña olvidada la sigue restableciendo tu admin.',+ 'E-mail address': 'Dirección de correo',+ 'That is already your sign-in e-mail.': 'Ese ya es tu correo de inicio de sesión.',+ 'E-mail saved': 'Correo guardado',+ 'Remove e-mail': 'Quitar correo',+ 'Remove your sign-in e-mail?': '¿Quitar tu correo de inicio de sesión?',+ 'Afterwards you sign in with your profile name only.': 'Después solo inicias sesión con el nombre de tu perfil.',+ 'E-mail removed': 'Correo quitado','Too many attempts — try again {0}.': 'Demasiados intentos — vuelve a intentarlo {0}.','Use at least {0} characters.': 'Usa al menos {0} caracteres.','That password is too long.': 'Esa contraseña es demasiado larga.',diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 4f0fa1a8a..fc3937a45 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -299,7 +299,6 @@ export default {'Passkey': 'Passkey','Passkeys use {0}. A password works too, where passkeys do not.': 'Les passkeys utilisent {0}. Là où elles ne fonctionnent pas, un mot de passe marche aussi.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Ce navigateur ne prend pas en charge les passkeys — connecte-toi plutôt avec ton nom et ton mot de passe.',- 'Use your profile name and the password you set for it.': 'Utilise le nom de ton profil et le mot de passe que tu lui as donné.','Have a reset code from your admin?': 'Tu as un code de réinitialisation de ton administrateur ?','Reset your password': 'Réinitialiser ton mot de passe','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Entre le code que ton administrateur t’a donné et choisis un nouveau mot de passe. Tu seras déconnecté partout ailleurs.',@@ -326,7 +325,27 @@ export default {'Remove your password?': 'Retirer ton mot de passe ?','Only your passkeys sign in to this profile afterwards.': 'Ensuite, seules tes passkeys permettent de te connecter à ce profil.','Password removed': 'Mot de passe retiré',- 'Wrong name or password.': 'Nom ou mot de passe incorrect.',+ 'Wrong name, e-mail or password.': 'Nom, e-mail ou mot de passe incorrect.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Utilise le nom de ton profil — ou l’e-mail que tu lui as ajouté — et ton mot de passe.',+ 'Name or e-mail': 'Nom ou e-mail',+ 'Enter your name or e-mail.': 'Saisis ton nom ou ton e-mail.',+ 'E-mail (optional)': 'E-mail (facultatif)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Te permet de te connecter avec lui au lieu de ton nom. Rien ne lui est jamais envoyé.',+ 'That is not an e-mail address.': 'Ce n’est pas une adresse e-mail.',+ 'Another profile already uses this e-mail address.': 'Un autre profil utilise déjà cette adresse e-mail.',+ 'Sign-in e-mail': 'E-mail de connexion',+ 'Sign in with “{0}” instead of your name': 'Connecte-toi avec « {0} » au lieu de ton nom',+ 'Not set — sign in with an e-mail instead of your name.': 'Non défini — connecte-toi avec un e-mail au lieu de ton nom.',+ 'Change sign-in e-mail': 'Modifier l’e-mail de connexion',+ 'Add a sign-in e-mail': 'Ajouter un e-mail de connexion',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Saisis-le dans « Se connecter avec un mot de passe » au lieu du nom de ton profil. Rien ne lui est jamais envoyé — un mot de passe oublié est toujours réinitialisé par ton admin.',+ 'E-mail address': 'Adresse e-mail',+ 'That is already your sign-in e-mail.': 'C’est déjà ton e-mail de connexion.',+ 'E-mail saved': 'E-mail enregistré',+ 'Remove e-mail': 'Retirer l’e-mail',+ 'Remove your sign-in e-mail?': 'Retirer ton e-mail de connexion ?',+ 'Afterwards you sign in with your profile name only.': 'Ensuite, tu te connectes uniquement avec le nom de ton profil.',+ 'E-mail removed': 'E-mail retiré','Too many attempts — try again {0}.': 'Trop de tentatives — réessaie {0}.','Use at least {0} characters.': 'Utilise au moins {0} caractères.','That password is too long.': 'Ce mot de passe est trop long.',diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 739ce35a4..001a10577 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -299,7 +299,6 @@ export default {'Passkey': 'पासकी','Passkeys use {0}. A password works too, where passkeys do not.': 'पासकी {0} का उपयोग करती हैं। जहाँ वे काम नहीं करतीं, वहाँ पासवर्ड भी चलता है।',"This browser doesn't support passkeys — sign in with your name and password instead.": 'यह ब्राउज़र पासकी का समर्थन नहीं करता — इसकी जगह अपने नाम और पासवर्ड से साइन इन करें।',- 'Use your profile name and the password you set for it.': 'अपनी प्रोफ़ाइल का नाम और उसके लिए सेट किया गया पासवर्ड इस्तेमाल करें।','Have a reset code from your admin?': 'क्या आपके पास एडमिन से मिला रीसेट कोड है?','Reset your password': 'अपना पासवर्ड रीसेट करें','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'अपने एडमिन से मिला कोड दर्ज करें और नया पासवर्ड चुनें। इससे आप बाकी हर जगह से साइन आउट हो जाएँगे।',@@ -326,7 +325,27 @@ export default {'Remove your password?': 'अपना पासवर्ड हटाएँ?','Only your passkeys sign in to this profile afterwards.': 'इसके बाद केवल आपकी पासकी से ही इस प्रोफ़ाइल में साइन इन होगा।','Password removed': 'पासवर्ड हटाया गया',- 'Wrong name or password.': 'नाम या पासवर्ड गलत है।',+ 'Wrong name, e-mail or password.': 'नाम, ईमेल या पासवर्ड गलत है।',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'अपनी प्रोफ़ाइल का नाम — या उसमें जोड़ा गया ईमेल — और अपना पासवर्ड इस्तेमाल करें।',+ 'Name or e-mail': 'नाम या ईमेल',+ 'Enter your name or e-mail.': 'अपना नाम या ईमेल डालें।',+ 'E-mail (optional)': 'ईमेल (वैकल्पिक)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'इससे आप अपने नाम की जगह इससे साइन इन कर सकते हैं। इस पर कभी कुछ नहीं भेजा जाता।',+ 'That is not an e-mail address.': 'यह ईमेल पता नहीं है।',+ 'Another profile already uses this e-mail address.': 'कोई दूसरी प्रोफ़ाइल पहले से यह ईमेल पता इस्तेमाल करती है।',+ 'Sign-in e-mail': 'साइन-इन ईमेल',+ 'Sign in with “{0}” instead of your name': 'अपने नाम की जगह "{0}" से साइन इन करें',+ 'Not set — sign in with an e-mail instead of your name.': 'सेट नहीं है — अपने नाम की जगह ईमेल से साइन इन करें।',+ 'Change sign-in e-mail': 'साइन-इन ईमेल बदलें',+ 'Add a sign-in e-mail': 'साइन-इन ईमेल जोड़ें',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': '"पासवर्ड से साइन इन करें" में अपनी प्रोफ़ाइल के नाम की जगह इसे लिखें। इस पर कभी कुछ नहीं भेजा जाता — भूला हुआ पासवर्ड अब भी आपका एडमिन रीसेट करता है।',+ 'E-mail address': 'ईमेल पता',+ 'That is already your sign-in e-mail.': 'यह पहले से आपका साइन-इन ईमेल है।',+ 'E-mail saved': 'ईमेल सहेजा गया',+ 'Remove e-mail': 'ईमेल हटाएँ',+ 'Remove your sign-in e-mail?': 'अपना साइन-इन ईमेल हटाएँ?',+ 'Afterwards you sign in with your profile name only.': 'इसके बाद आप सिर्फ़ अपनी प्रोफ़ाइल के नाम से साइन इन करेंगे।',+ 'E-mail removed': 'ईमेल हटाया गया','Too many attempts — try again {0}.': 'बहुत ज़्यादा प्रयास — {0} फिर से कोशिश करें।','Use at least {0} characters.': 'कम से कम {0} अक्षर इस्तेमाल करें।','That password is too long.': 'यह पासवर्ड बहुत लंबा है।',diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex e98126ecd..e7c29e50b 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -305,7 +305,6 @@ export default {'Passkey': 'Jelszókulcs','Passkeys use {0}. A password works too, where passkeys do not.': 'A jelszókulcs ezt használja: {0}. Ahol nem működik, jelszóval is megy.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Ez a böngésző nem támogatja a jelszókulcsokat — jelentkezz be inkább a neveddel és a jelszavaddal.',- 'Use your profile name and the password you set for it.': 'Használd a profilod nevét és a hozzá beállított jelszót.','Have a reset code from your admin?': 'Kaptál visszaállító kódot az adminisztrátortól?','Reset your password': 'Jelszó visszaállítása','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Add meg az adminisztrátortól kapott kódot, és válassz új jelszót. Ezzel minden más helyen kijelentkezel.',@@ -332,7 +331,27 @@ export default {'Remove your password?': 'Eltávolítod a jelszavad?','Only your passkeys sign in to this profile afterwards.': 'Ezután csak a jelszókulcsaiddal lehet belépni ebbe a profilba.','Password removed': 'Jelszó eltávolítva',- 'Wrong name or password.': 'Hibás név vagy jelszó.',+ 'Wrong name, e-mail or password.': 'Hibás név, e-mail vagy jelszó.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Használd a profilod nevét — vagy a hozzá adott e-mailt — és a jelszavadat.',+ 'Name or e-mail': 'Név vagy e-mail',+ 'Enter your name or e-mail.': 'Add meg a neved vagy az e-mailed.',+ 'E-mail (optional)': 'E-mail (nem kötelező)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'A neved helyett ezzel is bejelentkezhetsz. Soha nem küldünk rá semmit.',+ 'That is not an e-mail address.': 'Ez nem e-mail-cím.',+ 'Another profile already uses this e-mail address.': 'Egy másik profil már használja ezt az e-mail-címet.',+ 'Sign-in e-mail': 'Bejelentkezési e-mail',+ 'Sign in with “{0}” instead of your name': 'Bejelentkezés „{0}” címmel a neved helyett',+ 'Not set — sign in with an e-mail instead of your name.': 'Nincs beállítva — jelentkezz be e-maillel a neved helyett.',+ 'Change sign-in e-mail': 'Bejelentkezési e-mail módosítása',+ 'Add a sign-in e-mail': 'Bejelentkezési e-mail hozzáadása',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'A „Bejelentkezés jelszóval” képernyőn a profilod neve helyett ezt írd be. Soha nem küldünk rá semmit — elfelejtett jelszót továbbra is az adminod állít vissza.',+ 'E-mail address': 'E-mail-cím',+ 'That is already your sign-in e-mail.': 'Ez már a bejelentkezési e-mailed.',+ 'E-mail saved': 'E-mail mentve',+ 'Remove e-mail': 'E-mail eltávolítása',+ 'Remove your sign-in e-mail?': 'Eltávolítod a bejelentkezési e-mailed?',+ 'Afterwards you sign in with your profile name only.': 'Ezután csak a profilod nevével jelentkezhetsz be.',+ 'E-mail removed': 'E-mail eltávolítva','Too many attempts — try again {0}.': 'Túl sok próbálkozás — próbáld újra {0}.','Use at least {0} characters.': 'Legalább {0} karaktert használj.','That password is too long.': 'Ez a jelszó túl hosszú.',diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex dc07f8cfb..9ddda66ab 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -299,7 +299,6 @@ export default {'Passkey': 'Passkey','Passkeys use {0}. A password works too, where passkeys do not.': 'Le passkey usano {0}. Dove non funzionano, va bene anche una password.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Questo browser non supporta le passkey — accedi invece con nome e password.',- 'Use your profile name and the password you set for it.': 'Usa il nome del tuo profilo e la password che gli hai impostato.','Have a reset code from your admin?': 'Hai un codice di reimpostazione dal tuo amministratore?','Reset your password': 'Reimposta la password','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Inserisci il codice che ti ha dato il tuo amministratore e scegli una nuova password. Verrai disconnesso ovunque altrove.',@@ -326,7 +325,27 @@ export default {'Remove your password?': 'Rimuovere la password?','Only your passkeys sign in to this profile afterwards.': 'Dopo, si accede a questo profilo solo con le tue passkey.','Password removed': 'Password rimossa',- 'Wrong name or password.': 'Nome o password errati.',+ 'Wrong name, e-mail or password.': 'Nome, e-mail o password errati.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Usa il nome del tuo profilo — o l’e-mail che gli hai aggiunto — e la tua password.',+ 'Name or e-mail': 'Nome o e-mail',+ 'Enter your name or e-mail.': 'Inserisci il tuo nome o la tua e-mail.',+ 'E-mail (optional)': 'E-mail (facoltativa)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Ti permette di accedere con essa invece che con il nome. Non le viene mai inviato nulla.',+ 'That is not an e-mail address.': 'Questo non è un indirizzo e-mail.',+ 'Another profile already uses this e-mail address.': 'Un altro profilo usa già questo indirizzo e-mail.',+ 'Sign-in e-mail': 'E-mail di accesso',+ 'Sign in with “{0}” instead of your name': 'Accedi con «{0}» invece che con il tuo nome',+ 'Not set — sign in with an e-mail instead of your name.': 'Non impostata — accedi con un’e-mail invece che con il tuo nome.',+ 'Change sign-in e-mail': 'Cambia e-mail di accesso',+ 'Add a sign-in e-mail': 'Aggiungi un’e-mail di accesso',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Inseriscila in «Accedi con password» al posto del nome del profilo. Non le viene mai inviato nulla: una password dimenticata la reimposta sempre il tuo admin.',+ 'E-mail address': 'Indirizzo e-mail',+ 'That is already your sign-in e-mail.': 'È già la tua e-mail di accesso.',+ 'E-mail saved': 'E-mail salvata',+ 'Remove e-mail': 'Rimuovi e-mail',+ 'Remove your sign-in e-mail?': 'Rimuovere la tua e-mail di accesso?',+ 'Afterwards you sign in with your profile name only.': 'Dopo accedi solo con il nome del tuo profilo.',+ 'E-mail removed': 'E-mail rimossa','Too many attempts — try again {0}.': 'Troppi tentativi — riprova {0}.','Use at least {0} characters.': 'Usa almeno {0} caratteri.','That password is too long.': 'Questa password è troppo lunga.',diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 4947b314d..b02d1a57b 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -299,7 +299,6 @@ export default {'Passkey': '패스키','Passkeys use {0}. A password works too, where passkeys do not.': '패스키는 {0}을(를) 사용합니다. 패스키가 작동하지 않는 곳에서는 비밀번호도 됩니다.',"This browser doesn't support passkeys — sign in with your name and password instead.": '이 브라우저는 패스키를 지원하지 않습니다 — 대신 이름과 비밀번호로 로그인하세요.',- 'Use your profile name and the password you set for it.': '프로필 이름과 그 프로필에 설정한 비밀번호를 사용하세요.','Have a reset code from your admin?': '관리자에게 받은 재설정 코드가 있나요?','Reset your password': '비밀번호 재설정','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': '관리자에게 받은 코드를 입력하고 새 비밀번호를 정하세요. 다른 모든 곳에서는 로그아웃됩니다.',@@ -326,7 +325,27 @@ export default {'Remove your password?': '비밀번호를 제거할까요?','Only your passkeys sign in to this profile afterwards.': '이후에는 패스키로만 이 프로필에 로그인할 수 있습니다.','Password removed': '비밀번호 제거됨',- 'Wrong name or password.': '이름 또는 비밀번호가 올바르지 않습니다.',+ 'Wrong name, e-mail or password.': '이름, 이메일 또는 비밀번호가 올바르지 않습니다.',+ 'Use your profile name — or the e-mail you added to it — and your password.': '프로필 이름(또는 프로필에 추가한 이메일)과 비밀번호를 사용하세요.',+ 'Name or e-mail': '이름 또는 이메일',+ 'Enter your name or e-mail.': '이름이나 이메일을 입력하세요.',+ 'E-mail (optional)': '이메일(선택)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': '이름 대신 이메일로 로그인할 수 있습니다. 이 주소로는 아무것도 보내지 않습니다.',+ 'That is not an e-mail address.': '이메일 주소가 아닙니다.',+ 'Another profile already uses this e-mail address.': '다른 프로필이 이미 이 이메일 주소를 사용합니다.',+ 'Sign-in e-mail': '로그인 이메일',+ 'Sign in with “{0}” instead of your name': '이름 대신 "{0}"(으)로 로그인',+ 'Not set — sign in with an e-mail instead of your name.': '설정 안 됨 — 이름 대신 이메일로 로그인하세요.',+ 'Change sign-in e-mail': '로그인 이메일 변경',+ 'Add a sign-in e-mail': '로그인 이메일 추가',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': '"비밀번호로 로그인"에서 프로필 이름 대신 입력하세요. 이 주소로는 아무것도 보내지 않으며, 비밀번호를 잊으면 여전히 관리자가 재설정합니다.',+ 'E-mail address': '이메일 주소',+ 'That is already your sign-in e-mail.': '이미 로그인 이메일로 설정되어 있습니다.',+ 'E-mail saved': '이메일 저장됨',+ 'Remove e-mail': '이메일 제거',+ 'Remove your sign-in e-mail?': '로그인 이메일을 제거할까요?',+ 'Afterwards you sign in with your profile name only.': '이후에는 프로필 이름으로만 로그인합니다.',+ 'E-mail removed': '이메일 제거됨','Too many attempts — try again {0}.': '시도 횟수가 너무 많습니다 — {0} 다시 시도하세요.','Use at least {0} characters.': '최소 {0}자 이상 사용하세요.','That password is too long.': '비밀번호가 너무 깁니다.',diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 87dfbfcf5..8a26609a5 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -299,7 +299,6 @@ export default {'Passkey': 'Passkey','Passkeys use {0}. A password works too, where passkeys do not.': 'Passkey używa: {0}. Tam, gdzie nie działa, wystarczy też hasło.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Ta przeglądarka nie obsługuje passkey — zaloguj się zamiast tego nazwą i hasłem.',- 'Use your profile name and the password you set for it.': 'Użyj nazwy swojego profilu i hasła, które dla niego ustawiłeś.','Have a reset code from your admin?': 'Masz kod resetu od administratora?','Reset your password': 'Zresetuj hasło','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Wpisz kod od administratora i wybierz nowe hasło. Wszędzie indziej zostaniesz wylogowany.',@@ -326,7 +325,27 @@ export default {'Remove your password?': 'Usunąć hasło?','Only your passkeys sign in to this profile afterwards.': 'Potem do tego profilu zalogujesz się już tylko passkey.','Password removed': 'Hasło usunięte',- 'Wrong name or password.': 'Błędna nazwa lub hasło.',+ 'Wrong name, e-mail or password.': 'Błędna nazwa, e-mail lub hasło.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Użyj nazwy swojego profilu — albo e-maila, który do niego dodałeś — i swojego hasła.',+ 'Name or e-mail': 'Nazwa lub e-mail',+ 'Enter your name or e-mail.': 'Wpisz swoją nazwę lub e-mail.',+ 'E-mail (optional)': 'E-mail (opcjonalnie)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Pozwala logować się nim zamiast nazwą. Nic nigdy nie jest na niego wysyłane.',+ 'That is not an e-mail address.': 'To nie jest adres e-mail.',+ 'Another profile already uses this e-mail address.': 'Inny profil używa już tego adresu e-mail.',+ 'Sign-in e-mail': 'E-mail do logowania',+ 'Sign in with “{0}” instead of your name': 'Loguj się „{0}” zamiast nazwą',+ 'Not set — sign in with an e-mail instead of your name.': 'Nie ustawiono — loguj się e-mailem zamiast nazwą.',+ 'Change sign-in e-mail': 'Zmień e-mail do logowania',+ 'Add a sign-in e-mail': 'Dodaj e-mail do logowania',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Wpisz go w „Zaloguj się hasłem” zamiast nazwy profilu. Nic nigdy nie jest na niego wysyłane — zapomniane hasło nadal resetuje twój admin.',+ 'E-mail address': 'Adres e-mail',+ 'That is already your sign-in e-mail.': 'To już jest twój e-mail do logowania.',+ 'E-mail saved': 'E-mail zapisany',+ 'Remove e-mail': 'Usuń e-mail',+ 'Remove your sign-in e-mail?': 'Usunąć e-mail do logowania?',+ 'Afterwards you sign in with your profile name only.': 'Potem logujesz się już tylko nazwą profilu.',+ 'E-mail removed': 'E-mail usunięty','Too many attempts — try again {0}.': 'Za dużo prób — spróbuj ponownie {0}.','Use at least {0} characters.': 'Użyj co najmniej {0} znaków.','That password is too long.': 'To hasło jest za długie.',diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex c644d04cd..f671b341a 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -309,7 +309,6 @@ export const PT_BR_OVERRIDES = {'Passkey': 'Chave de acesso','Passkeys use {0}. A password works too, where passkeys do not.': 'As chaves de acesso usam {0}. Onde elas não funcionam, uma senha também serve.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Este navegador não é compatível com chaves de acesso — entre com seu nome e sua senha.',- 'Use your profile name and the password you set for it.': 'Use o nome do seu perfil e a senha que você definiu para ele.','Have a reset code from your admin?': 'Tem um código de redefinição do seu administrador?','Reset your password': 'Redefinir sua senha','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Digite o código que seu administrador deu e escolha uma nova senha. Você sai de todos os outros lugares.',@@ -335,7 +334,27 @@ export const PT_BR_OVERRIDES = {'Remove your password?': 'Remover sua senha?','Only your passkeys sign in to this profile afterwards.': 'Depois disso, só suas chaves de acesso entram neste perfil.','Password removed': 'Senha removida',- 'Wrong name or password.': 'Nome ou senha incorretos.',+ 'Wrong name, e-mail or password.': 'Nome, e-mail ou senha incorretos.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Use o nome do seu perfil — ou o e-mail que você adicionou a ele — e a sua senha.',+ 'Name or e-mail': 'Nome ou e-mail',+ 'Enter your name or e-mail.': 'Digite seu nome ou e-mail.',+ 'E-mail (optional)': 'E-mail (opcional)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Permite que você entre com ele em vez do seu nome. Nada é enviado para ele.',+ 'That is not an e-mail address.': 'Isso não é um endereço de e-mail.',+ 'Another profile already uses this e-mail address.': 'Outro perfil já usa este endereço de e-mail.',+ 'Sign-in e-mail': 'E-mail de login',+ 'Sign in with “{0}” instead of your name': 'Entre com “{0}” em vez do seu nome',+ 'Not set — sign in with an e-mail instead of your name.': 'Não definido — entre com um e-mail em vez do seu nome.',+ 'Change sign-in e-mail': 'Alterar e-mail de login',+ 'Add a sign-in e-mail': 'Adicionar um e-mail de login',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Digite-o em “Entrar com senha” em vez do nome do seu perfil. Nada é enviado para ele — uma senha esquecida continua sendo redefinida pelo seu admin.',+ 'E-mail address': 'Endereço de e-mail',+ 'That is already your sign-in e-mail.': 'Esse já é o seu e-mail de login.',+ 'E-mail saved': 'E-mail salvo',+ 'Remove e-mail': 'Remover e-mail',+ 'Remove your sign-in e-mail?': 'Remover seu e-mail de login?',+ 'Afterwards you sign in with your profile name only.': 'Depois disso, você entra só com o nome do seu perfil.',+ 'E-mail removed': 'E-mail removido','Too many attempts — try again {0}.': 'Muitas tentativas — tente novamente {0}.','Use at least {0} characters.': 'Use pelo menos {0} caracteres.','That password is too long.': 'Essa senha é longa demais.',diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex d74a6a03e..d78d39e45 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -299,7 +299,6 @@ export default {'Passkey': 'Passkey','Passkeys use {0}. A password works too, where passkeys do not.': 'As passkeys usam {0}. Onde não funcionam, uma palavra-passe também serve.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Este navegador não suporta passkeys — inicia sessão com o teu nome e a tua palavra-passe.',- 'Use your profile name and the password you set for it.': 'Usa o nome do teu perfil e a palavra-passe que definiste para ele.','Have a reset code from your admin?': 'Tens um código de reposição do teu administrador?','Reset your password': 'Repor a palavra-passe','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Introduz o código que o teu administrador te deu e escolhe uma nova palavra-passe. Terminas a sessão em todos os outros sítios.',@@ -326,7 +325,27 @@ export default {'Remove your password?': 'Remover a tua palavra-passe?','Only your passkeys sign in to this profile afterwards.': 'Depois disso, só as tuas passkeys iniciam sessão neste perfil.','Password removed': 'Palavra-passe removida',- 'Wrong name or password.': 'Nome ou palavra-passe errados.',+ 'Wrong name, e-mail or password.': 'Nome, e-mail ou palavra-passe errados.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Usa o nome do teu perfil — ou o e-mail que lhe adicionaste — e a tua palavra-passe.',+ 'Name or e-mail': 'Nome ou e-mail',+ 'Enter your name or e-mail.': 'Escreve o teu nome ou e-mail.',+ 'E-mail (optional)': 'E-mail (opcional)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Permite-te iniciar sessão com ele em vez do teu nome. Nunca lhe é enviado nada.',+ 'That is not an e-mail address.': 'Isso não é um endereço de e-mail.',+ 'Another profile already uses this e-mail address.': 'Outro perfil já usa este endereço de e-mail.',+ 'Sign-in e-mail': 'E-mail de início de sessão',+ 'Sign in with “{0}” instead of your name': 'Inicia sessão com «{0}» em vez do teu nome',+ 'Not set — sign in with an e-mail instead of your name.': 'Não definido — inicia sessão com um e-mail em vez do teu nome.',+ 'Change sign-in e-mail': 'Alterar e-mail de início de sessão',+ 'Add a sign-in e-mail': 'Adicionar um e-mail de início de sessão',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Escreve-o em «Iniciar sessão com palavra-passe» em vez do nome do teu perfil. Nunca lhe é enviado nada — uma palavra-passe esquecida continua a ser reposta pelo teu admin.',+ 'E-mail address': 'Endereço de e-mail',+ 'That is already your sign-in e-mail.': 'Esse já é o teu e-mail de início de sessão.',+ 'E-mail saved': 'E-mail guardado',+ 'Remove e-mail': 'Remover e-mail',+ 'Remove your sign-in e-mail?': 'Remover o teu e-mail de início de sessão?',+ 'Afterwards you sign in with your profile name only.': 'Depois disso, inicias sessão apenas com o nome do teu perfil.',+ 'E-mail removed': 'E-mail removido','Too many attempts — try again {0}.': 'Demasiadas tentativas — tenta novamente {0}.','Use at least {0} characters.': 'Usa pelo menos {0} caracteres.','That password is too long.': 'Essa palavra-passe é demasiado longa.',diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex bb4a4e4a0..7c49aca07 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -299,7 +299,6 @@ export default {'Passkey': 'Ключ доступа','Passkeys use {0}. A password works too, where passkeys do not.': 'Ключи доступа используют {0}. Где они не работают, подойдёт и пароль.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Этот браузер не поддерживает ключи доступа — войди по имени и паролю.',- 'Use your profile name and the password you set for it.': 'Используй имя профиля и пароль, который ты для него задал.','Have a reset code from your admin?': 'Есть код сброса от администратора?','Reset your password': 'Сброс пароля','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Введи код от администратора и выбери новый пароль. Во всех остальных местах ты выйдешь из аккаунта.',@@ -326,7 +325,27 @@ export default {'Remove your password?': 'Удалить пароль?','Only your passkeys sign in to this profile afterwards.': 'После этого войти в этот профиль можно будет только по ключам доступа.','Password removed': 'Пароль удалён',- 'Wrong name or password.': 'Неверное имя или пароль.',+ 'Wrong name, e-mail or password.': 'Неверное имя, e-mail или пароль.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Используй имя профиля — или e-mail, который ты к нему добавил, — и свой пароль.',+ 'Name or e-mail': 'Имя или e-mail',+ 'Enter your name or e-mail.': 'Введи имя или e-mail.',+ 'E-mail (optional)': 'E-mail (необязательно)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Позволяет входить с ним вместо имени. На него никогда ничего не отправляется.',+ 'That is not an e-mail address.': 'Это не адрес e-mail.',+ 'Another profile already uses this e-mail address.': 'Другой профиль уже использует этот адрес e-mail.',+ 'Sign-in e-mail': 'E-mail для входа',+ 'Sign in with “{0}” instead of your name': 'Входи с «{0}» вместо имени',+ 'Not set — sign in with an e-mail instead of your name.': 'Не задан — входи с e-mail вместо имени.',+ 'Change sign-in e-mail': 'Изменить e-mail для входа',+ 'Add a sign-in e-mail': 'Добавить e-mail для входа',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Вводи его в «Войти по паролю» вместо имени профиля. На него никогда ничего не отправляется — забытый пароль по-прежнему сбрасывает твой админ.',+ 'E-mail address': 'Адрес e-mail',+ 'That is already your sign-in e-mail.': 'Это уже твой e-mail для входа.',+ 'E-mail saved': 'E-mail сохранён',+ 'Remove e-mail': 'Удалить e-mail',+ 'Remove your sign-in e-mail?': 'Удалить e-mail для входа?',+ 'Afterwards you sign in with your profile name only.': 'После этого ты входишь только по имени профиля.',+ 'E-mail removed': 'E-mail удалён','Too many attempts — try again {0}.': 'Слишком много попыток — попробуй снова {0}.','Use at least {0} characters.': 'Используй не меньше {0} символов.','That password is too long.': 'Этот пароль слишком длинный.',diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex fea736433..77f56310b 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -305,7 +305,6 @@ export default {'Passkey': 'พาสคีย์','Passkeys use {0}. A password works too, where passkeys do not.': 'พาสคีย์ใช้ {0} ในที่ที่พาสคีย์ใช้ไม่ได้ ใช้รหัสผ่านก็ได้',"This browser doesn't support passkeys — sign in with your name and password instead.": 'เบราว์เซอร์นี้ไม่รองรับพาสคีย์ — เข้าสู่ระบบด้วยชื่อและรหัสผ่านแทน',- 'Use your profile name and the password you set for it.': 'ใช้ชื่อโปรไฟล์และรหัสผ่านที่คุณตั้งไว้สำหรับโปรไฟล์นั้น','Have a reset code from your admin?': 'มีรหัสรีเซ็ตจากผู้ดูแลระบบใช่ไหม?','Reset your password': 'รีเซ็ตรหัสผ่านของคุณ','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'กรอกรหัสที่ได้จากผู้ดูแลระบบ แล้วตั้งรหัสผ่านใหม่ คุณจะออกจากระบบในที่อื่นทั้งหมด',@@ -332,7 +331,27 @@ export default {'Remove your password?': 'ลบรหัสผ่านของคุณ?','Only your passkeys sign in to this profile afterwards.': 'หลังจากนี้ จะเข้าสู่โปรไฟล์นี้ได้ด้วยพาสคีย์เท่านั้น','Password removed': 'ลบรหัสผ่านแล้ว',- 'Wrong name or password.': 'ชื่อหรือรหัสผ่านไม่ถูกต้อง',+ 'Wrong name, e-mail or password.': 'ชื่อ อีเมล หรือรหัสผ่านไม่ถูกต้อง',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'ใช้ชื่อโปรไฟล์ — หรืออีเมลที่คุณเพิ่มไว้ — และรหัสผ่านของคุณ',+ 'Name or e-mail': 'ชื่อหรืออีเมล',+ 'Enter your name or e-mail.': 'ใส่ชื่อหรืออีเมลของคุณ',+ 'E-mail (optional)': 'อีเมล (ไม่บังคับ)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'ให้คุณเข้าสู่ระบบด้วยอีเมลแทนชื่อได้ ไม่มีการส่งอะไรไปที่อีเมลนี้เลย',+ 'That is not an e-mail address.': 'นี่ไม่ใช่ที่อยู่อีเมล',+ 'Another profile already uses this e-mail address.': 'มีโปรไฟล์อื่นใช้ที่อยู่อีเมลนี้อยู่แล้ว',+ 'Sign-in e-mail': 'อีเมลสำหรับเข้าสู่ระบบ',+ 'Sign in with “{0}” instead of your name': 'เข้าสู่ระบบด้วย “{0}” แทนชื่อของคุณ',+ 'Not set — sign in with an e-mail instead of your name.': 'ยังไม่ได้ตั้ง — เข้าสู่ระบบด้วยอีเมลแทนชื่อของคุณ',+ 'Change sign-in e-mail': 'เปลี่ยนอีเมลสำหรับเข้าสู่ระบบ',+ 'Add a sign-in e-mail': 'เพิ่มอีเมลสำหรับเข้าสู่ระบบ',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'พิมพ์อีเมลนี้ที่ “เข้าสู่ระบบด้วยรหัสผ่าน” แทนชื่อโปรไฟล์ ไม่มีการส่งอะไรไปที่อีเมลนี้เลย — ถ้าลืมรหัสผ่าน แอดมินยังคงเป็นผู้รีเซ็ตให้',+ 'E-mail address': 'ที่อยู่อีเมล',+ 'That is already your sign-in e-mail.': 'นี่เป็นอีเมลสำหรับเข้าสู่ระบบของคุณอยู่แล้ว',+ 'E-mail saved': 'บันทึกอีเมลแล้ว',+ 'Remove e-mail': 'ลบอีเมล',+ 'Remove your sign-in e-mail?': 'ลบอีเมลสำหรับเข้าสู่ระบบหรือไม่',+ 'Afterwards you sign in with your profile name only.': 'หลังจากนั้นคุณจะเข้าสู่ระบบด้วยชื่อโปรไฟล์เท่านั้น',+ 'E-mail removed': 'ลบอีเมลแล้ว','Too many attempts — try again {0}.': 'ลองหลายครั้งเกินไป — ลองใหม่อีกครั้ง{0}','Use at least {0} characters.': 'ใช้อย่างน้อย {0} ตัวอักษร','That password is too long.': 'รหัสผ่านนี้ยาวเกินไป',diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex 4fd25a6d0..830550870 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -299,7 +299,6 @@ export default {'Passkey': 'Geçiş anahtarı','Passkeys use {0}. A password works too, where passkeys do not.': 'Geçiş anahtarları {0} kullanır. Çalışmadıkları yerde şifre de olur.',"This browser doesn't support passkeys — sign in with your name and password instead.": 'Bu tarayıcı geçiş anahtarlarını desteklemiyor — bunun yerine isim ve şifreyle giriş yap.',- 'Use your profile name and the password you set for it.': 'Profil adını ve onun için belirlediğin şifreyi kullan.','Have a reset code from your admin?': 'Yöneticinden aldığın bir sıfırlama kodu mu var?','Reset your password': 'Şifreni sıfırla','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Yöneticinin verdiği kodu gir ve yeni bir şifre seç. Diğer her yerde oturumun kapanır.',@@ -326,7 +325,27 @@ export default {'Remove your password?': 'Şifren kaldırılsın mı?','Only your passkeys sign in to this profile afterwards.': 'Bundan sonra bu profile yalnızca geçiş anahtarlarınla giriş yapılabilir.','Password removed': 'Şifre kaldırıldı',- 'Wrong name or password.': 'İsim veya şifre yanlış.',+ 'Wrong name, e-mail or password.': 'İsim, e-posta veya şifre yanlış.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Profil adını — ya da ona eklediğin e-postayı — ve şifreni kullan.',+ 'Name or e-mail': 'İsim veya e-posta',+ 'Enter your name or e-mail.': 'İsmini veya e-postanı gir.',+ 'E-mail (optional)': 'E-posta (isteğe bağlı)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'İsmin yerine bununla giriş yapmanı sağlar. Bu adrese asla bir şey gönderilmez.',+ 'That is not an e-mail address.': 'Bu bir e-posta adresi değil.',+ 'Another profile already uses this e-mail address.': 'Başka bir profil bu e-posta adresini zaten kullanıyor.',+ 'Sign-in e-mail': 'Giriş e-postası',+ 'Sign in with “{0}” instead of your name': 'İsmin yerine “{0}” ile giriş yap',+ 'Not set — sign in with an e-mail instead of your name.': 'Belirlenmedi — ismin yerine bir e-postayla giriş yap.',+ 'Change sign-in e-mail': 'Giriş e-postasını değiştir',+ 'Add a sign-in e-mail': 'Giriş e-postası ekle',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': '“Şifreyle giriş yap” ekranında profil adının yerine bunu yaz. Bu adrese asla bir şey gönderilmez — unutulan şifreyi yine yöneticin sıfırlar.',+ 'E-mail address': 'E-posta adresi',+ 'That is already your sign-in e-mail.': 'Bu zaten giriş e-postan.',+ 'E-mail saved': 'E-posta kaydedildi',+ 'Remove e-mail': 'E-postayı kaldır',+ 'Remove your sign-in e-mail?': 'Giriş e-postan kaldırılsın mı?',+ 'Afterwards you sign in with your profile name only.': 'Bundan sonra yalnızca profil adınla giriş yaparsın.',+ 'E-mail removed': 'E-posta kaldırıldı','Too many attempts — try again {0}.': 'Çok fazla deneme — {0} tekrar dene.','Use at least {0} characters.': 'En az {0} karakter kullan.','That password is too long.': 'Bu şifre çok uzun.',diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 3939c2323..c94bb2db0 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -1459,7 +1459,6 @@ export default {'Passkey': 'Ключ доступу','Passkeys use {0}. A password works too, where passkeys do not.': 'Ключі доступу використовують {0}. Там, де вони не працюють, підійде й пароль.','This browser doesn\'t support passkeys — sign in with your name and password instead.': 'Цей браузер не підтримує ключі доступу — увійди за іменем і паролем.',- 'Use your profile name and the password you set for it.': 'Вкажи назву профілю та пароль, заданий для нього.','Have a reset code from your admin?': 'Маєш код скидання від адміністратора?','Reset your password': 'Скидання пароля','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': 'Введи код від адміністратора й обери новий пароль. На всіх інших пристроях ти вийдеш з акаунта.',@@ -1486,7 +1485,27 @@ export default {'Remove your password?': 'Видалити пароль?','Only your passkeys sign in to this profile afterwards.': 'Після цього увійти в профіль можна буде лише ключами доступу.','Password removed': 'Пароль видалено',- 'Wrong name or password.': 'Неправильне ім’я або пароль.',+ 'Wrong name, e-mail or password.': 'Неправильне ім’я, e-mail або пароль.',+ 'Use your profile name — or the e-mail you added to it — and your password.': 'Вкажи назву профілю — або e-mail, який ти до нього додав, — і свій пароль.',+ 'Name or e-mail': 'Ім’я або e-mail',+ 'Enter your name or e-mail.': 'Введи ім’я або e-mail.',+ 'E-mail (optional)': 'E-mail (необов’язково)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': 'Дає змогу входити з ним замість імені. На нього ніколи нічого не надсилається.',+ 'That is not an e-mail address.': 'Це не адреса e-mail.',+ 'Another profile already uses this e-mail address.': 'Інший профіль уже використовує цю адресу e-mail.',+ 'Sign-in e-mail': 'E-mail для входу',+ 'Sign in with “{0}” instead of your name': 'Входь з «{0}» замість імені',+ 'Not set — sign in with an e-mail instead of your name.': 'Не задано — входь з e-mail замість імені.',+ 'Change sign-in e-mail': 'Змінити e-mail для входу',+ 'Add a sign-in e-mail': 'Додати e-mail для входу',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': 'Вводь його в «Увійти з паролем» замість назви профілю. На нього ніколи нічого не надсилається — забутий пароль і далі скидає твій адмін.',+ 'E-mail address': 'Адреса e-mail',+ 'That is already your sign-in e-mail.': 'Це вже твій e-mail для входу.',+ 'E-mail saved': 'E-mail збережено',+ 'Remove e-mail': 'Видалити e-mail',+ 'Remove your sign-in e-mail?': 'Видалити e-mail для входу?',+ 'Afterwards you sign in with your profile name only.': 'Після цього ти входиш лише за назвою профілю.',+ 'E-mail removed': 'E-mail видалено','Too many attempts — try again {0}.': 'Забагато спроб — спробуй ще раз {0}.','Use at least {0} characters.': 'Використай щонайменше {0} символів.','That password is too long.': 'Цей пароль задовгий.',diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex bf35418ca..5db072187 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -299,7 +299,6 @@ export default {'Passkey': '通行密钥','Passkeys use {0}. A password works too, where passkeys do not.': '通行密钥使用{0}。在通行密钥无法使用的地方,也可以用密码。',"This browser doesn't support passkeys — sign in with your name and password instead.": '此浏览器不支持通行密钥 — 请改用名字和密码登录。',- 'Use your profile name and the password you set for it.': '使用你的档案名字和你为它设置的密码。','Have a reset code from your admin?': '有管理员给的重置码?','Reset your password': '重置你的密码','Enter the code your admin gave you and choose a new password. It signs you out everywhere else.': '输入管理员给你的代码,并设置新密码。你在其他所有地方都会被退出登录。',@@ -326,7 +325,27 @@ export default {'Remove your password?': '移除你的密码?','Only your passkeys sign in to this profile afterwards.': '之后只能用你的通行密钥登录此档案。','Password removed': '密码已移除',- 'Wrong name or password.': '名字或密码错误。',+ 'Wrong name, e-mail or password.': '名字、邮箱或密码错误。',+ 'Use your profile name — or the e-mail you added to it — and your password.': '使用你的档案名字(或你为它添加的邮箱)和你的密码。',+ 'Name or e-mail': '名字或邮箱',+ 'Enter your name or e-mail.': '请输入你的名字或邮箱。',+ 'E-mail (optional)': '邮箱(可选)',+ 'Lets you sign in with it instead of your name. Nothing is ever sent to it.': '可以用它代替名字登录。不会向它发送任何邮件。',+ 'That is not an e-mail address.': '这不是邮箱地址。',+ 'Another profile already uses this e-mail address.': '已有另一个档案在使用这个邮箱地址。',+ 'Sign-in e-mail': '登录邮箱',+ 'Sign in with “{0}” instead of your name': '用“{0}”代替名字登录',+ 'Not set — sign in with an e-mail instead of your name.': '未设置 — 用邮箱代替名字登录。',+ 'Change sign-in e-mail': '更改登录邮箱',+ 'Add a sign-in e-mail': '添加登录邮箱',+ 'Type it at “Sign in with password” instead of your profile name. Nothing is ever sent to it — a forgotten password is still reset by your admin.': '在“用密码登录”中用它代替档案名字。不会向它发送任何邮件 — 忘记密码仍由管理员重置。',+ 'E-mail address': '邮箱地址',+ 'That is already your sign-in e-mail.': '这已经是你的登录邮箱。',+ 'E-mail saved': '邮箱已保存',+ 'Remove e-mail': '移除邮箱',+ 'Remove your sign-in e-mail?': '移除你的登录邮箱?',+ 'Afterwards you sign in with your profile name only.': '之后你只能用档案名字登录。',+ 'E-mail removed': '邮箱已移除','Too many attempts — try again {0}.': '尝试次数过多 — 请{0}再试。','Use at least {0} characters.': '至少使用 {0} 个字符。','That password is too long.': '这个密码太长了。',diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsxindex bfd8434eb..9dbfd21b1 100644--- a/frontend/src/views/Admin.jsx+++ b/frontend/src/views/Admin.jsx@@ -32,12 +32,12 @@ const dur = ms => { const m = Math.max(0, Math.floor(ms / 60000)); return m < 60// The one time the reset code is visible. Locked, so a tap beside the sheet cannot lose it// before it has been copied or written down.-function ResetCodeSheet({ name, code, expires, close }) {+function ResetCodeSheet({ name, email, code, expires, close }) {const toast = useUI(s => s.toast)const copy = () => { navigator.clipboard?.writeText(code).catch(() => {}); toast('Copied') }return <><h3>Reset code for {name}</h3>- <div className="adm-lead">Give them this code. They choose “Sign in with password” → “Have a reset code from your admin?”, enter their name <b>{name}</b>, the code and a new password. It works once, until {new Date(expires).toLocaleString()}, and will not be shown again.</div>+ <div className="adm-lead">Give them this code. They choose “Sign in with password” → “Have a reset code from your admin?”, enter their name <b>{name}</b>{email && <> (or their sign-in e-mail <b>{email}</b>)</>}, the code and a new password. It works once, until {new Date(expires).toLocaleString()}, and will not be shown again.</div><button className="adm-code" style={{ fontSize: 22, width: '100%', padding: '14px 0' }} onClick={copy} aria-label="copy code">{code}</button><div style={{ height: 12 }} /><Button variant="primary" onClick={close}>Done</Button>@@ -85,7 +85,7 @@ function UserDetail({ id, onChanged, close }) {confirmText: 'Create reset code',danger: true,onConfirm: () => api('/api/admin/user/password-reset', { method: 'POST', body: JSON.stringify({ id: u.id }) })- .then(r => { onChanged(); close(); openSheet(done => <ResetCodeSheet name={r.name} code={r.code} expires={r.expires} close={done} />, { locked: true }) })+ .then(r => { onChanged(); close(); openSheet(done => <ResetCodeSheet name={r.name} email={u.email} code={r.code} expires={r.expires} close={done} />, { locked: true }) }).catch(e => toast(e.message)),})return <>@@ -95,6 +95,8 @@ function UserDetail({ id, onChanged, close }) {{u.disabled && <span className="adm-pill bad">disabled</span>}{u.invitedBy && <span className="adm-pill">invite {u.invitedBy}</span>}{u.password && <span className="adm-pill">password</span>}+ {/* The sign-in e-mail (password instances only): shown to admins and nobody else. */}+ {u.email && <span className="adm-pill" title="sign-in e-mail">{u.email}</span>}{u.resetUntil && <span className="adm-pill acc">reset code until {new Date(u.resetUntil).toLocaleString()}</span>}<span className="adm-pill">joined {u.created ? fmtDate(u.created.slice(0, 10)) : '—'}</span></div>@@ -326,7 +328,8 @@ export default function Admin() {<div className="list">{(users || []).map(u => <div key={u.id} className="item" onClick={() => openUser(u.id)} style={u.disabled ? { opacity: .55 } : null}><div className="grow"><div className="tt">{u.live && <Icon name="dot" style={{ fontSize: 9, color: 'var(--green)', display: 'inline-block', marginInlineEnd: 5 }} />}{u.name} {u.admin && <span className="adm-pill acc" style={{ marginInlineStart: 4 }}>admin</span>}{u.disabled && <span className="adm-pill bad" style={{ marginInlineStart: 4 }}>disabled</span>}</div>- <div className="ss">{u.live ? 'training now · ' + u.live.name : u.workouts + ' workouts' + (u.lastWorkout ? ' · last ' + fmtDate(u.lastWorkout) : '') + ' · last sync ' + rel(u.lastSync)}</div></div>+ <div className="ss">{u.live ? 'training now · ' + u.live.name : u.workouts + ' workouts' + (u.lastWorkout ? ' · last ' + fmtDate(u.lastWorkout) : '') + ' · last sync ' + rel(u.lastSync)}</div>+ {u.email && <div className="ss" title="sign-in e-mail">{u.email}</div>}</div>{u.hasPush && <Icon name="bell" title="push notifications on" style={{ fontSize: 15, color: 'var(--label-3)' }} />}<Icon name="chevronRight" className="chev" /></div>)}{users && !users.length && <div className="adm-empty">No users yet.</div>}diff --git a/frontend/src/views/Admin.password.test.jsx b/frontend/src/views/Admin.password.test.jsxindex 8a88f0d14..42b1a33b0 100644--- a/frontend/src/views/Admin.password.test.jsx+++ b/frontend/src/views/Admin.password.test.jsx@@ -112,3 +112,27 @@ describe('Admin → Reset password', () => {expect(sheet.textContent).toMatch(/reset code until/)})})++describe('Admin → sign-in e-mail', () => {+ it('shows the address in the list and on the profile, and names it on the reset code sheet', async () => {+ mocks.answers['/api/admin/users'] = { users: [{ id: 'u1', name: 'Mallory', workouts: 0, lastSync: null, disabled: false, password: true, email: '[email protected]' }], invite_only: false, password_login: true }+ mocks.answers['/api/admin/user'] = detail({ password: true, email: '[email protected]', resetUntil: null })+ const page = render(<Admin />)+ await settle()+ expect([...page.querySelectorAll('.item')].find(el => el.textContent.includes('Mallory')).textContent).toContain('[email protected]')+ const sheet = await openMallory()+ expect([...sheet.querySelectorAll('.adm-pill')].map(p => p.textContent)).toContain('[email protected]')+ act(() => button(sheet, 'Reset password').click())+ const before = mocks.sheets.length+ await act(async () => { await mocks.confirm.mock.calls[0][0].onConfirm() })+ await settle()+ const code = render(mocks.sheets.slice(before).find(s => s.opts?.locked).render(() => {}))+ expect(code.textContent).toContain('or their sign-in e-mail [email protected]')+ })++ it('shows nothing where the server sends no address', async () => {+ mocks.answers['/api/admin/user'] = detail({ password: true, email: null, resetUntil: null })+ const sheet = await openMallory()+ expect(sheet.textContent).not.toContain('@')+ })+})