feat(email): PWA login sends code only; drop admin link from alert emails #185
Reference in New Issue
Block a user
Delete Branch "feature/pwa-login-code-only"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two email changes (both requested by the owner in one pass).
1. Code-only login from an installed PWA
A login requested while running as a standalone PWA now omits the one-tap confirm link from the email. That link opens in a separate browser whose minted session cannot reach the PWA (separate storage), so the login stranded there while the PWA sat on the form. Now the PWA-origin login email carries only the six-digit code, typed in the same window.
pwaflag (isStandalone()) on the email-code request — newEmailRequestRequest.pwaFBS field, threaded through the gateway to the backend.pwais set, reusing the existing deletion-code link-omission path (issueCodeomitLink).2. Security: no admin link in alert emails
The operator alert digest (
internal/adminalert) embedded a direct/_gmadmin-console URL. An admin URL must never travel in an email, where a mail provider could cache or index it. Removed the console link entirely (field + param + digest line + themain.goconstruction); the operator opens the console directly.Tests
pwafield.Verify (local, all green)
go build/vet/test ./backend/... ./gateway/...+gofmt; the email integration suite on a real Postgres;pnpm check(0 errors) +test:unit(419) +build+ bundle-size (110.8/112) + full e2e (196). FBS regen churn limited to the one table.Docs
ARCHITECTURE (the deeplink PWA exception + the alert-email no-link note), FUNCTIONAL (+ru) the email-login-from-PWA note.