Skip to content

Feat/two factor auth - #323

Merged
parkerwinner merged 2 commits into
parkerwinner:mainfrom
infimum90:feat/two-factor-auth
Aug 31, 2026
Merged

Feat/two factor auth#323
parkerwinner merged 2 commits into
parkerwinner:mainfrom
infimum90:feat/two-factor-auth

Conversation

@infimum90

Copy link
Copy Markdown
Contributor

Closes #315 Frontend error handling — fix/frontend-error-handling

Created frontend/src/services/errorHandler.js:1 centralized service: StellarErrorCodes, STELLAR_USER_MESSAGES, parseStellarError(), handleStellarError(), handleAppError() with mapping for Horizon result_codes (tx_failed, op_underfunded, etc.) and HTTP status → user-friendly messages.
Created frontend/src/services/stellar.ts:1 full Stellar SDK wrapper (getAccount, getBalances, sendPayment, createTrustline, accountExists) that throws StellarServiceError with code/userMessage via centralized handler.
Extended frontend/src/config.js:59 with HORIZON_URL per network.
Updated frontend/src/services/api.js:1 interceptor to normalize via handleAppError.
Updated frontend/src/components/RemittanceForm.js:85 to display userMessage.

Closes #317 2FA — feat/two-factor-auth

Fixed backend/handlers/auth.go:374 SetupMFA to persist totp_secret after GenerateTOTPSecret() (pquerna/otp) so VerifyMFA can validate.
Fixed backend/handlers/auth.go:432 DisableMFA to use SetupMFARequest (password-only) instead of requiring email.
Wired routes in backend/main.go:90 for /api/v1 and /api/v2: POST /auth/forgot-password, POST /auth/reset-password, POST /auth/mfa/setup, POST /auth/mfa/verify, POST /auth/mfa/disable, GET /auth/mfa/status.
Added backend/migrations/000011_add_mfa.up.sql:1 (totp_secret, mfa_enabled, mfa_setup_completed_at).
Frontend: frontend/src/services/api.js:51 MFA helpers + frontend/src/components/TwoFactorSetup.js:1 QR/verify/disable UI.

Closes #316 Dependencies — chore/update-frontend-dependencies

Updated frontend/package.json:5 to latest stable: @stellar/stellar-sdk ^11.2.2→^13.3.0, axios ^1.6.5→^1.9.0, react/react-dom ^18.2.0→^19.1.0, react-router-dom ^6.21.1→^7.4.1, @testing-library/jest-dom ^6.1.5→^6.6.3, @testing-library/react ^14.1.2→^16.1.0, @testing-library/user-event ^14.5.1→^14.6.3.

Closes #314 High-value multi-sig — feat/multisig-escrow

Added DataKey::HighValueThreshold/HighValueRequiredSignatures/HighValueEscrowApprovers in contracts/src/payment_escrow.rs:496.
Implemented admin-configurable set_high_value_threshold, set_high_value_required_signatures, configure_high_value_escrow, is_high_value_escrow, apply_high_value_multisig (auto-enables multi_party_enabled, injects MultiSignature condition, initializes MultiPartyConfig with configurable required signatures), plus setup_high_value_approvers.
Wired into create_escrow:1712 and create_multi_asset_escrow:1843 to enforce quorum (QuorumNotMet) on release/refund for high-value escrows.

- Backend: fix SetupMFA to persist TOTP secret (pquerna/otp) so VerifyMFA can validate
- Backend: fix DisableMFA to accept password-only payload (SetupMFARequest) instead of requiring email
- Backend: wire MFA routes in main.go for both /api/v1 and /api/v2 (/auth/mfa/setup, /auth/mfa/verify, /auth/mfa/disable, /auth/mfa/status) and expose forgot/reset password routes
- Backend: add migration 000011_add_mfa (totp_secret, mfa_enabled, mfa_setup_completed_at)
- Frontend: extend services/api.js with MFA helpers (setupMFA, verifyMFA, disableMFA, getMFAStatus) and auth helpers
- Frontend: add TwoFactorSetup component handling TOTP QR display, code verification, and disable flow

Fixes parkerwinner#317
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@infimum90 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

@parkerwinner
parkerwinner merged commit befcdeb into parkerwinner:main Aug 31, 2026
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