From fb74789de19543df16b7b601430dcb76351e97b2 Mon Sep 17 00:00:00 2001 From: Juan Castro Date: Thu, 10 Sep 2026 16:41:03 -0400 Subject: [PATCH] feat: email a seat its username and temporary password, when an address is given Follows the previous commit. Dropping the email field entirely went one step too far: without an address the temporary password shown once in the panel is the only copy, and an admin who closes that panel has to issue a new one. The field is back, marked optional, and now it buys something concrete. `team_account_created` carried no credential -- it said the team "will send you a temporary password separately". It now carries the username and the temporary password, so an admin who supplies an address hands nothing over by side channel. `#notifyUser` takes extra template variables, and both credential-issuing paths pass the one they just minted: provisioning and re-issue. Re-issue passing the fresh credential rather than the stale one is the case worth checking, and there is a test that asserts the old password is absent from that mail. With no address nothing is sent, which was already true -- `#notifyUser` returns early without one -- and is now covered. The docs said the notice carries no credential in two places. Both corrected. Falsified: dropping the credential from the re-issue call fails "emails the fresh credential on re-issue, not the old one" and nothing else. 178 backend tests, 326 GUI/SDK tests, typecheck clean. --- src/backend/clients/email/templates.ts | 8 ++- src/backend/services/team/TeamService.test.ts | 69 ++++++++++++++++++- src/backend/services/team/TeamService.ts | 17 ++--- src/docs/src/Teams/createMember.md | 4 +- src/docs/src/Teams/resendActivation.md | 2 +- src/gui/src/UI/Dashboard/TabTeams.js | 9 ++- src/gui/src/i18n/translations/en.js | 2 + 7 files changed, 94 insertions(+), 17 deletions(-) diff --git a/src/backend/clients/email/templates.ts b/src/backend/clients/email/templates.ts index 0eaf36730..8fed1986c 100644 --- a/src/backend/clients/email/templates.ts +++ b/src/backend/clients/email/templates.ts @@ -351,9 +351,11 @@ support@puter.com immediately. subject: 'Your {{team_name}} account on Puter', html: `

Hi there,

-

{{team_name}} has created a Puter account for you: {{username}}. -They will send you a temporary password separately; you will be asked to -choose your own the first time you sign in.

+

{{team_name}} has created a Puter account for you.

+

Username: {{username}}
+Temporary password: {{temporary_password}}

+

You will be asked to choose your own password the first time you sign in. +This temporary one stops working then, and it expires on its own if unused.

What this means: