feat: enhance player login process with captcha validation and improve wallet display logic
Some checks failed
lotteryfront CI / build (push) Has been cancelled

- Added captcha validation to the player login screen, requiring users to input a captcha code for authentication.
- Implemented a new API call to fetch captcha images, improving security during login.
- Updated wallet display logic to ensure accurate representation of available and total balances based on player funding modes.
- Enhanced documentation in AGENTS.md to clarify changes in credit flow and login requirements.
This commit is contained in:
2026-06-17 15:27:06 +08:00
parent 9711909893
commit 2f1793e0cf
13 changed files with 211 additions and 20 deletions

View File

@@ -62,6 +62,32 @@ export function HallWalletStrip() {
const availableMinor = Number(balance?.available_balance ?? balance?.balance ?? 0);
const isCreditPlayer = isCreditFundingPlayer(balance);
const balanceMinor = Number(balance?.balance ?? 0);
const headlineMinor = isCreditPlayer ? availableMinor : balanceMinor;
const transferInLotteryMinor = isCreditPlayer ? availableMinor : balanceMinor;
// #region agent log
if (typeof window !== "undefined" && balance && !loading) {
fetch("http://127.0.0.1:7696/ingest/e56128e6-898b-4d61-b06d-2aefe0923744", {
method: "POST",
headers: { "Content-Type": "application/json", "X-Debug-Session-Id": "7fd0fc" },
body: JSON.stringify({
sessionId: "7fd0fc",
runId: "hall-wallet-display-post-fix",
hypothesisId: "H3",
location: "hall-wallet-strip.tsx:render",
message: "hall wallet headline amounts",
data: {
isCreditPlayer,
availableMinor,
balanceMinor,
headlineMinor,
mismatchWithWalletPage: !isCreditPlayer && headlineMinor !== balanceMinor,
},
timestamp: Date.now(),
}),
}).catch(() => {});
}
// #endregion
const mainMinor =
balance?.main_balance === null || balance?.main_balance === undefined
? null
@@ -102,7 +128,7 @@ export function HallWalletStrip() {
<Skeleton className="mt-2 h-8 w-44 rounded-md bg-white/25" />
) : (
<p className="mt-1 text-2xl font-black leading-none tabular-nums tracking-normal">
{formatMinorAsCurrency(availableMinor, currency)}
{formatMinorAsCurrency(headlineMinor, currency)}
</p>
)}
</div>
@@ -117,7 +143,7 @@ export function HallWalletStrip() {
triggerLabel={t("wallet.transferIn")}
triggerClassName="h-12 rounded-lg text-base font-bold"
currency={currency}
lotteryMinor={availableMinor}
lotteryMinor={transferInLotteryMinor}
mainMinor={mainMinor}
onSuccess={async () => { await mutate(BALANCE_KEY(currency)); }}
/>