From a32329fbb41a3b07d970626af98720d20b19e79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 24 Nov 2026 23:33:39 +0100 Subject: [PATCH] M1 review: reference site types and an e2e check of the bound SMTP password Co-Authored-By: Claude Fable 5.2 --- reference/e2e/smoke.spec.ts | 4 ++++ reference/src/payload-types.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/reference/e2e/smoke.spec.ts b/reference/e2e/smoke.spec.ts index d6f91b0..32dee65 100644 --- a/reference/e2e/smoke.spec.ts +++ b/reference/e2e/smoke.spec.ts @@ -252,5 +252,9 @@ test('API: a staff password without the 2FA code opens nothing; with the code it // the secret is stored (create-test-admin.ts) and never returned, also to a fully signed-in admin expect(after.data.SiteIntegration.smtpPassword).toBe('********') expect(JSON.stringify(after)).not.toContain('e2e-sink') + // …and it stays with the server it was saved for: moving the server without typing the password again is refused + const moved = await api.post('/api/globals/site-integrations', { data: { smtpHost: 'elsewhere.example.com' } }) + expect(moved.status()).toBe(400) + expect(await moved.text()).toMatch(/Enter the password again|Wpisz hasło ponownie/) await api.dispose() }) diff --git a/reference/src/payload-types.ts b/reference/src/payload-types.ts index 9abab69..14664dd 100644 --- a/reference/src/payload-types.ts +++ b/reference/src/payload-types.ts @@ -2799,6 +2799,10 @@ export interface SiteIntegration { * Usually 587, or 465. */ smtpPort?: number | null; + /** + * The password is sent only over an encrypted connection; without one, no e-mail is sent. + */ + smtpRequireTls?: boolean | null; smtpUser?: string | null; smtpPassword?: string | null; emailStatus?: { @@ -3220,6 +3224,7 @@ export interface SiteIntegrationsSelect { smtpFromName?: T; smtpHost?: T; smtpPort?: T; + smtpRequireTls?: T; smtpUser?: T; smtpPassword?: T; emailStatus?: