Feat/two factor auth - #323
Merged
Merged
Conversation
- 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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.