Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/backend/src/settings/email-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export function verificationEmail(
input: { code: string; verifyUrl: string },
ctx: EmailBrandContext,
): RenderedEmail {
const shown = /^\d{6}$/.test(input.code) ? `${input.code.slice(0, 3)} ${input.code.slice(3)}` : input.code;
return build({
// Code first: it is what the inbox preview shows, and what iOS reads to
// offer it above the keyboard (autocomplete one-time-code).
Expand All @@ -77,7 +76,11 @@ export function verificationEmail(
bodyHtml:
h1('Confirm your email,', 'and you are in.') +
p('Enter this code in the AnythingMCP window you just left. It is valid for 15 minutes.') +
codeBox(shown) +
// The code exactly as it is typed: no space between the two halves. The
// box's letter-spacing already spaces the digits out to read, while a
// real space was copied along with them, so a pasted "504 452" no
// longer fitted the six-character field (October 2026).
codeBox(input.code) +
p('Or confirm with one click:', { size: 15, muted: true, mb: 4 }) +
button(input.verifyUrl, 'Verify my email') +
small("Didn't sign up? You can ignore this email; the address stays unverified without the code."),
Expand Down
4 changes: 3 additions & 1 deletion packages/backend/src/settings/email.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ describe('EmailService', () => {
await expect(service.sendVerificationEmail('a@b.com', '123456', 'https://cloud.anythingmcp.com/v?t=1')).resolves.toBe(true);
const mail = sent();
expect(mail.subject).toBe('123456 is your AnythingMCP verification code');
expect(mail.html).toContain('123 456');
// Shown exactly as typed: a space between the halves was copied with them.
expect(mail.html).toContain('>123456<');
expect(mail.html).not.toContain('123 456');
expect(mail.text).toContain('123456');
expect(mail.headers).toBeUndefined();
expect(mail.html).not.toContain('Unsubscribe');
Expand Down
7 changes: 5 additions & 2 deletions packages/frontend/src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
if (offerCardTrial(storedUser, trialResult)) return;
setTrialDaysLeft(trialResult.trialDaysLeft);
setSetupStep('trial-activated');
} catch (trialErr: any) {

Check warning on line 381 in packages/frontend/src/app/login/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend (lint, typecheck, build)

'trialErr' is defined but never used
// Trial may already exist (e.g. returning user) — go to dashboard
goTo(redirectTo);
}
Expand Down Expand Up @@ -491,9 +491,12 @@
// Mail) or a message right above the keyboard.
autoComplete="one-time-code"
name="one-time-code"
maxLength={6}
// No maxLength: the browser cuts a paste to that length before
// onChange runs, so "504 452" (a space, as older emails showed
// it) arrived as "504 45" and the code could not be submitted.
// Keep the digits of whatever is pasted, then the first six.
value={verificationCode}
onChange={(e) => setVerificationCode(e.target.value.replace(/\D/g, ''))}
onChange={(e) => setVerificationCode(e.target.value.replace(/\D/g, '').slice(0, 6))}
placeholder="000000"
className="w-full text-center text-2xl tracking-[0.5em] font-mono h-12 rounded-[9px] border border-[var(--border)] bg-[var(--surface)] px-3 text-[var(--text)] placeholder:text-[var(--text-3)] outline-none transition-colors focus:border-[var(--brand)] focus:ring-2 focus:ring-[var(--brand-ring)]"
autoFocus
Expand Down
Loading