From f91029d9df83e44e2f6accf82c8cdc8c715d615c Mon Sep 17 00:00:00 2001 From: joshuakrueger-dfx Date: Tue, 9 Jun 2026 11:40:10 +0200 Subject: [PATCH 1/2] fix(auth): brand login mail by login source instead of account history 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). --- .../generic/user/models/auth/auth.service.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/subdomains/generic/user/models/auth/auth.service.ts b/src/subdomains/generic/user/models/auth/auth.service.ts index dbf1f0734e..47add535f2 100644 --- a/src/subdomains/generic/user/models/auth/auth.service.ts +++ b/src/subdomains/generic/user/models/auth/auth.service.ts @@ -259,6 +259,11 @@ export class AuthService { const ipCountry = this.geoLocationService.getCountry(userIp); const language = await this.languageService.getLanguageByCountry(ipCountry); + // wallet the login originated from - determines mail branding (e.g. DFX vs. RealUnit) + const loginWallet = dto.wallet + ? await this.walletService.getByIdOrName(undefined, dto.wallet) + : await this.walletService.getDefault(); + const userData = (await this.userDataService .getUsersByMail(dto.mail) @@ -268,9 +273,7 @@ export class AuthService { mail: dto.mail, language: dto.language ?? language, status: UserDataStatus.KYC_ONLY, - wallet: dto.wallet - ? await this.walletService.getByIdOrName(undefined, dto.wallet) - : await this.walletService.getDefault(), + wallet: loginWallet, })); if (dto.recommendationCode) await this.confirmRecommendationCode(dto.recommendationCode, userData); @@ -301,6 +304,7 @@ export class AuthService { context: MailContext.LOGIN, input: { userData, + wallet: loginWallet, title: `${MailTranslationKey.LOGIN}.title`, salutation: { key: `${MailTranslationKey.LOGIN}.salutation` }, texts: [ From bad89d648d56bc95b92b066a824de79375359166 Mon Sep 17 00:00:00 2001 From: joshuakrueger-dfx Date: Tue, 9 Jun 2026 12:02:49 +0200 Subject: [PATCH 2/2] fix(auth): always resolve a concrete login wallet for mail branding guarantees branding follows the login source even when an unknown wallet name is passed, so it never falls back to the account-history override --- src/subdomains/generic/user/models/auth/auth.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/subdomains/generic/user/models/auth/auth.service.ts b/src/subdomains/generic/user/models/auth/auth.service.ts index 47add535f2..69189c7154 100644 --- a/src/subdomains/generic/user/models/auth/auth.service.ts +++ b/src/subdomains/generic/user/models/auth/auth.service.ts @@ -259,10 +259,11 @@ export class AuthService { const ipCountry = this.geoLocationService.getCountry(userIp); const language = await this.languageService.getLanguageByCountry(ipCountry); - // wallet the login originated from - determines mail branding (e.g. DFX vs. RealUnit) - const loginWallet = dto.wallet - ? await this.walletService.getByIdOrName(undefined, dto.wallet) - : await this.walletService.getDefault(); + // wallet the login originated from - determines mail branding (e.g. DFX vs. RealUnit); + // always resolve to a concrete wallet so branding follows the login source and never falls back to account history + const loginWallet = + (dto.wallet && (await this.walletService.getByIdOrName(undefined, dto.wallet))) || + (await this.walletService.getDefault()); const userData = (await this.userDataService