Skip to content

fix: validation dedup, secure cookie, quiz refetch, xdr shadowing - #658

Merged
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
nonsobethel0-dev:feat/482-483-484-485-validation-cookie-reload-shadow
Oct 20, 2026
Merged

DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
nonsobethel0-dev:feat/482-483-484-485-validation-cookie-reload-shadow

Conversation

@nonsobethel0-dev

Copy link
Copy Markdown
Contributor

Fixes #482, Fixes #483, Fixes #484, Fixes #485

What changed

Issue #485 — xdr parameter shadowing

  • Renamed xdr parameter to txXdr in claimRewardOnChain and mintCredentialOnChain
  • Prevents silent shadowing of stellar-sdk xdr module import

Issue #483 — Session cookie Secure flag

  • Added Secure flag to chainlearn-session cookie in auth-store.ts
  • Prevents JWT token transmission over unencrypted HTTP

Issue #484 — Quiz page state-based refresh

  • Added refetch callback to useQuiz hook
  • Enables targeted data refetch instead of full page reload

Issue #482 — Onboarding validation deduplication

  • Created src/lib/utils/validation.ts with validateDisplayName
  • Updated onboarding page to use shared validator
  • Removes inline validation checks that could drift out of sync

Files changed

  • src/lib/stellar/contracts.ts — renamed shadowed parameter
  • src/store/auth-store.ts — added Secure cookie flag
  • src/lib/hooks/use-quiz.ts — added refetch callback
  • src/lib/utils/validation.ts — new shared validation utility
  • src/app/(auth)/onboarding/page.tsx — use shared validator

How to test

  1. Check claimRewardOnChain — no xdr shadowing
  2. Inspect cookie — Secure flag present on HTTPS
  3. Call refetch() on useQuiz — data refreshes without reload
  4. Submit onboarding with invalid name — shared validation error shown

Fixes ChainLearnOfficial#482, Fixes ChainLearnOfficial#483, Fixes ChainLearnOfficial#484, Fixes ChainLearnOfficial#485

Issue ChainLearnOfficial#485 — xdr parameter shadowing in contracts.ts:
- Renamed xdr parameter to txXdr in claimRewardOnChain and mintCredentialOnChain
- Prevents silent shadowing of stellar-sdk xdr module

Issue ChainLearnOfficial#483 — Session cookie Secure flag:
- Added Secure flag to chainlearn-session cookie
- Prevents token transmission over HTTP

Issue ChainLearnOfficial#484 — Quiz page state-based refresh:
- Added refetch callback to useQuiz hook
- Eliminates need for window.location.reload()

Issue ChainLearnOfficial#482 — Onboarding validation deduplication:
- Created shared validation.ts with validateDisplayName
- Updated onboarding page to use shared validator
- Removes inline validation checks
@netlify

netlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for chainlearn failed.

Name Link
🔨 Latest commit 0691398
🔍 Latest deploy log https://app.netlify.com/projects/chainlearn/deploys/6ad7df3909040f1fad6c9ab3

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@nonsobethel0-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@DeFiVC
DeFiVC merged commit 3cc71e2 into ChainLearnOfficial:main Oct 20, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants