Background
PR #3846 fixed login mail branding by reading dto.wallet from the auth request. This works correctly for wallet-signature login (POST /v1/auth) since the RealUnit app already sends wallet: 'RealUnit'.
Two gaps remain:
1. Email login doesn't send the wallet
For POST /v1/auth/mail, frontends currently don't send wallet. Without it, loginWallet falls back to walletService.getDefault() (DFX), so the login mail branding may be wrong for non-DFX frontends that support email login.
2. Wallet context at login time is never persisted
In doSignIn() and signInByMail(), the wallet from dto.wallet is never stored anywhere for existing users. This is valuable information — knowing which app a user logged in from — and should be logged per login event.
Proposed Solution
Log wallet name in IpLog
IpLog is already the per-login audit trail (IP, country, walletType, linked user/userData). Add a walletName column and populate it from the login request in IpLogService.create().
Call sites in auth.service.ts (doSignIn, signInByMail, completeSignInByMail) should pass dto.wallet through to ipLogService.create().
Frontends
All frontends must send wallet in every auth request where the wallet name is known:
POST /v1/auth (wallet-signature login) — RealUnit already does this; other frontends should be verified
POST /v1/auth/mail (email login) — needs to be added in frontends that support email login
The wallet field already exists on AuthMailDto and SignInDto/SignUpDto as optional, so this is non-breaking.
Background
PR #3846 fixed login mail branding by reading
dto.walletfrom the auth request. This works correctly for wallet-signature login (POST /v1/auth) since the RealUnit app already sendswallet: 'RealUnit'.Two gaps remain:
1. Email login doesn't send the wallet
For
POST /v1/auth/mail, frontends currently don't sendwallet. Without it,loginWalletfalls back towalletService.getDefault()(DFX), so the login mail branding may be wrong for non-DFX frontends that support email login.2. Wallet context at login time is never persisted
In
doSignIn()andsignInByMail(), the wallet fromdto.walletis never stored anywhere for existing users. This is valuable information — knowing which app a user logged in from — and should be logged per login event.Proposed Solution
Log wallet name in
IpLogIpLogis already the per-login audit trail (IP, country,walletType, linked user/userData). Add awalletNamecolumn and populate it from the login request inIpLogService.create().Call sites in
auth.service.ts(doSignIn,signInByMail,completeSignInByMail) should passdto.walletthrough toipLogService.create().Frontends
All frontends must send
walletin every auth request where the wallet name is known:POST /v1/auth(wallet-signature login) — RealUnit already does this; other frontends should be verifiedPOST /v1/auth/mail(email login) — needs to be added in frontends that support email loginThe
walletfield already exists onAuthMailDtoandSignInDto/SignUpDtoas optional, so this is non-breaking.