Becodemy

Hi everyone πŸ‘‹ Here’s a new update on the ongoing eCommerce project. Follow me on twitter to get more real time updatesπŸ”₯
Twitter account: x.com/ishahriarsajeeb

πŸ› οΈ 1. User Registration with OTP Verification
βœ… React Hook Form for client-side validation.
βœ… TanStack Query for managing mutations (API requests) and handling loading/error states.
βœ… Users must verify their email via OTP before completing registration.
βœ… OTP is sent to the user’s email upon registration.
βœ… If OTP is correct, the user is successfully registered in the database.
βœ… If OTP is wrong, the user gets a warning (with limited attempts).

πŸ›‘οΈ 2. Strong Anti-Spam & Security Mechanisms
βœ… 1-minute cooldown ⏳ between OTP requests to prevent spamming.
βœ… Maximum 3 OTP requests per hour – if exceeded, email is locked for 1 hour. πŸ”’
βœ… Account lock for 30 minutes πŸ•’ after 3 incorrect OTP attempts.
βœ… OTP expires in 5 minutes – forcing users to use it quickly.
βœ… Duplicate accounts prevention – No two users can have the same email.

πŸ“› 3. Protection Against Brute Force & Repeated Requests
βœ… Failed OTP attempts are tracked (max 3 tries).
βœ… After 3 wrong OTP entries, the account is locked for 30 minutes.
βœ… Prevents attackers from guessing OTPs repeatedly.
βœ… Email OTP request tracking:
- More than 3 OTP requests within an hour Email is blocked for 1 hour.
- Prevents bots from abusing the email system.

πŸ“§ 4. OTP Management & Delivery System
βœ… OTPs are randomly generated (4-digit codes).
βœ… OTPs are sent via email using an automated system. πŸ“©
βœ… Redis temporarily stores OTPs for validation (auto-expires in 5 mins).
βœ… Users can resend OTPs, but only within security limits.

♻️ 5. Full User Registration Flow
1️⃣ User submits name, email, and password.
2️⃣ System sends OTP to the email.
3️⃣ User enters OTP.
4️⃣ If OTP is correct βœ… β†’ Account is created. πŸŽ‰
5️⃣ If OTP is wrong ❌ β†’ User gets limited retries.
6️⃣ If wrong OTP entered 3 times, account is locked for 30 mins.
7️⃣ If OTP requested too many times, email is blocked for 1 hour.

This system is built for real-world authentication with the best security measures in place! πŸ’ͺ

What do you think? Would you add any more features?

7 months ago | [YT] | 107