๐๐ผ๐ ๐ก๐ผ๐ ๐๐ผ ๐๐๐ถ๐น๐ฑ ๐ฎ ๐๐ผ๐ด๐ถ๐ป ๐ฆ๐๐๐๐ฒ๐บ
Stop building simple login systems. Secure authentication is not enough. You need extra layers.
Put a CAPTCHA on your signup form. This stops bots from making fake accounts.
Do not put a CAPTCHA on the login page for everyone. It ruins the user experience.
Instead, track failed login attempts. Show the CAPTCHA after 3 to 5 failures. This stops brute force attacks.
Store these attempts in a database. Do not rely on cookies. Attackers change cookies. A database tracks users across different devices.
Track users by email, IP, or phone number.
Use a table with these fields:
- ID
- IP
- Count
- Timestamps
Take these steps after 5 failed attempts:
- Force a CAPTCHA until the user logs in.
- Lock the form for a set time.
- Block the account and force a password reset.
Mix and match these methods to fit your needs.
Source: https://dev.to/juddee/how-not-to-build-a-login-signup-system-4fc5