Skip to content

Two factor Authentification#446

Merged
mftee merged 1 commit into
CodeGirlsInc:mainfrom
RUKAYAT-CODER:feat-two-factor-authentification
Apr 26, 2026
Merged

Two factor Authentification#446
mftee merged 1 commit into
CodeGirlsInc:mainfrom
RUKAYAT-CODER:feat-two-factor-authentification

Conversation

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

close #342
close #339
close #352
close #351

  1. User Notification Preferences Management
    Created: backend/cmmty/notification-prefs/ with entity, module, controller, and service
    Entity: NotificationPrefs with userId (PK), riskAlert, verificationComplete, weeklyDigest fields
    Endpoints: GET and PATCH /cmmty/users/me/notification-preferences
    Integration: Updated MailService to check preferences before sending emails
    Tests: Comprehensive unit tests for preference retrieval and update functionality

  2. Platform Analytics Tracking Service
    Created: backend/cmmty/analytics/ with module, controller, and service
    Endpoint: GET /cmmty/admin/analytics with period parameter (7d, 30d, 90d)
    Features: Time-series data for uploads, verifications, and new users; aggregate risk metrics
    Security: Admin-only access with role validation
    Tests: Unit tests for data aggregation logic and date range handling

  3. Bulk Document Upload Support
    Created: backend/cmmty/bulk-upload/ with module, controller, and service
    Endpoint: POST /cmmty/documents/bulk accepting up to 10 files
    Features: Individual file processing, partial failure handling, file validation
    Validation: 20MB size limit and MIME type validation for each file
    Tests: Unit tests for batch validation and partial failure scenarios

  4. TOTP Two-Factor Authentication
    Created: backend/cmmty/two-factor-auth/ with module, controller, and service
    Package: Installed and integrated speakeasy for TOTP generation/verification
    Endpoints:
    POST /cmmty/auth/2fa/generate - returns QR code URI and backup codes
    POST /cmmty/auth/2fa/enable - verifies TOTP code and enables 2FA
    POST /cmmty/auth/2fa/verify - called during login when 2FA is active
    Entity Updates: Added two-factor fields to User entity

Tests: Comprehensive unit tests for TOTP generation and verification
All implementations follow the existing project patterns, include proper error handling, validation, and comprehensive unit tests. Each module has been properly integrated into the main application module and follows NestJS best practices.

@vercel

vercel Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Mftee's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Apr 25, 2026

Copy link
Copy Markdown

@RUKAYAT-CODER 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

@mftee mftee merged commit c15752d into CodeGirlsInc:main Apr 26, 2026
1 of 4 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