Skip to content

fix(auth): brand login mail by login source instead of account history#3846

Merged
TaprootFreak merged 2 commits into
developfrom
fix/login-mail-branding-follows-source
Jun 9, 2026
Merged

fix(auth): brand login mail by login source instead of account history#3846
TaprootFreak merged 2 commits into
developfrom
fix/login-mail-branding-follows-source

Conversation

@joshuakrueger-dfx

Copy link
Copy Markdown
Collaborator

Problem

Logging in at app.dfx.swiss sent a RealUnit-branded confirmation mail instead of a DFX one.

Cause

resolveMailWallet (notification.service.ts, introduced in #3612) decided mail branding per account, not per login source: if a userData had any User row linked to a wallet flagged isPreferred: true (only RealUnit), every mail got RealUnit branding (template, sender, forced German). signInByMail never set input.wallet, so the if (input.wallet) return early-out never fired and the account-based override always won — even for app.dfx.swiss logins.

Fix

signInByMail now resolves the originating login wallet once (dto.walletgetByIdOrName, else getDefault) and passes it explicitly as input.wallet. Branding now follows the login source:

  • app.dfx.swiss (wallet: Mail) → DFX branding
  • realunit.app (wallet: RealUnit) → RealUnit branding

Also de-duplicates the wallet lookup (resolved once, reused for createUserData and the mail).

Notes

Relies on the calling client sending its wallet on mail login (app.dfx.swiss already sends WalletType.MAIL; realunit.app sends its own). tsc --noEmit green.

resolveMailWallet forced any account ever linked to a preferred wallet
(RealUnit) onto RealUnit branding, so logins via app.dfx.swiss received
RealUnit confirmation mails. signInByMail now resolves the originating
login wallet once and passes it explicitly, so branding follows the
login source (DFX vs. RealUnit).
guarantees branding follows the login source even when an unknown wallet
name is passed, so it never falls back to the account-history override
@TaprootFreak TaprootFreak merged commit 5e36ac4 into develop Jun 9, 2026
7 of 8 checks passed
@TaprootFreak TaprootFreak deleted the fix/login-mail-branding-follows-source branch June 9, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants