Skip to content

Commit b2f9b26

Browse files
committed
refactor(plugin-auth): move AuthManager's email and SMS delivery into auth-manager-email-sms-delivery.ts
Seven method bodies move unedited: sendChangeEmailNotice, getOtpSendGuard, assertPhoneOtpSendAllowed, deliverPhoneOtp, sendPhoneInviteSms, storedRecipientLocale and renderPhoneSmsBody. The four module-level declarations only they read move with them: the SMS quota refusal code and its matcher, the quota wall's 429, and the one phone OTP send refusal code. The class keeps all seven methods, their docblocks and signatures, and hands each body the members it reads. The APIError pin's file list, the dispatcher error vocabulary row for deliverPhoneOtp and the five-sends population comments follow the moved text. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LSXBc2GCBwiAL7vV4kWkyr
1 parent ca381a8 commit b2f9b26

5 files changed

Lines changed: 527 additions & 332 deletions

File tree

‎packages/plugins/plugin-auth/src/api-error-code.pin.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ describe('every new APIError( in plugin-auth/src carries an ADR-0112 code (#2424
180180
'auth-manager-actor-guards.ts',
181181
'auth-manager-sign-in-lockout.ts',
182182
'auth-manager-password-session-policy.ts',
183+
'auth-manager-email-sms-delivery.ts',
183184
];
184185
expect(sites.length).toBeGreaterThanOrEqual(30);
185186
expect(new Set(sites.map((s) => s.file)).size).toBeGreaterThanOrEqual(4);

‎packages/plugins/plugin-auth/src/auth-email-locale.test.ts‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,12 @@ describe("#14641 — an invitation reads the INVITEE's own sys_user.locale", ()
858858
*
859859
* ⚠️ POPULATION of the class claim these blocks close, stated rather than
860860
* implied: the auth mail surface is the five `sendTemplate` call sites in
861-
* `auth-manager.ts` — `IEmailService` declares exactly two delivering members
862-
* (`send`, `sendTemplate`), plugin-auth's only `.send(` calls are the SMS
863-
* service's, and no other file under `plugin-auth/src` calls either. Those
864-
* five are the same five `driveAllFive` above drives and `TEMPLATES` names.
861+
* `auth-manager.ts` and `auth-manager-email-sms-delivery.ts` (the body of the
862+
* change-email notice) — `IEmailService` declares exactly two delivering
863+
* members (`send`, `sendTemplate`), plugin-auth's only `.send(` calls are the
864+
* SMS service's, and no other file under `plugin-auth/src` calls either.
865+
* Those five are the same five `driveAllFive` above drives and `TEMPLATES`
866+
* names.
865867
* Before this change four of them read the column and `sendMagicLink` did not;
866868
* `the whole surface reads it` is pinned below by driving all five against one
867869
* recipient-keyed engine, not by asserting it about this send alone.
@@ -1120,8 +1122,9 @@ describe('#15106 — the CLASS claim: all five auth sends read the recipient col
11201122
});
11211123

11221124
it('every one of the five sends is written in the stored language of its own recipient', async () => {
1123-
// ⚠️ POPULATION: the five `sendTemplate` sites in `auth-manager.ts` — the
1124-
// same five `driveAllFive` drives and `TEMPLATES` names, and the whole of
1125+
// ⚠️ POPULATION: the five `sendTemplate` sites in `auth-manager.ts` and
1126+
// `auth-manager-email-sms-delivery.ts` — the same five `driveAllFive`
1127+
// drives and `TEMPLATES` names, and the whole of
11251128
// plugin-auth's mail surface (see this section's header). This is the pin
11261129
// that closes the class; the per-send pins above only cover one member.
11271130
//

0 commit comments

Comments
 (0)