feat: Merge 2FA functionality from workshop branch to main#1
Merged
Hugo-Galley merged 1 commit intomainfrom Sep 24, 2025
Merged
Conversation
Copilot
AI
changed the title
[WIP] Je veux que tu m'ajoute sur une nouvelle branche la main actuelle avec les modifications du commit 84220d6d39275ce5427d9732f9ba2a38491e4172 de la branch worksop en plus dedans.
feat: Merge 2FA functionality from workshop branch to main
Sep 24, 2025
Hugo-Galley
approved these changes
Sep 24, 2025
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.
This PR merges the comprehensive Two-Factor Authentication (2FA) system from commit
84220d6d39275ce5427d9732f9ba2a38491e4172in the workshop branch into the main branch, creating a new branchmain-with-2fawith enhanced security features.🔐 What's Added
The 2FA implementation provides mandatory two-factor authentication for all user registration and login flows using Time-based One-Time Passwords (TOTP).
Backend Changes
verification_hashcolumn to Users table for 2FA validationFrontend Changes
2FA.jswith TOTP generation, secret key management, and .secrets file handlingTwoFactorDisplaycomponent showing real-time TOTP codes with countdown timer🛠️ Technical Improvements
__dirnameissues in Vite configuration for proper ES module support🔒 Security Features
📋 Files Modified
Backend (6 files):
BackEnd/BDD/bdd.sql- Database schema updateBackEnd/config.py- 2FA configurationBackEnd/routes/users.py- New verification endpointsBackEnd/models.py- User model updatesBackEnd/Class/api_class_body.py- API body classesBackEnd/add_verification_hash.sql- Migration scriptFrontend (7 files):
FrontEnd/src/scripts/2FA.js- Complete 2FA library (new)FrontEnd/src/components/auth/TwoFactorDisplay.jsx- TOTP display component (new)FrontEnd/src/scripts/Auth.js- Refactored authentication flowFrontEnd/src/components/auth/LoginForm.jsx- Updated login flowFrontEnd/src/components/auth/RegisterForm.jsx- Updated registration flowFrontEnd/src/Styles/Auth.css- 2FA styling additionsFrontEnd/vite.config.js- ES module compatibility fix🧪 Quality Assurance
The implementation follows security best practices with client-side TOTP generation and server-side validation, ensuring robust two-factor authentication without compromising user experience.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.