Lewati ke konten
← Back to Notes

14 October 2026 · 4 min read

Passwordless login: email OTP without the hassle

Why the admin panel uses OTP, how abuse is limited, and what happens when email fails.

Contents
  1. Passwords are debt
  2. The limits I set
  3. When email fails

Passwords are debt

The admin panel is used by one person, a few times a week. A password means hashing, length rules, resets, and one more secret that can leak. Email OTP removes all of it: the owner just opens their inbox.

What still needs protecting is not the password but the delivery flow — send limits, code lifetime, and what happens after repeated wrong attempts.

The limits I set

Six-digit codes are valid for ten minutes and single-use. Three requests per 15 minutes, at most 30 per day. Five wrong attempts lock the email address for 15 minutes. Sessions live on the server rather than in a token that cannot be revoked.

There is also a single-use recovery code kept outside the repo — for the case where email itself is the problem. Without it, one locked inbox means the panel cannot be opened at all.

When email fails

Email services can reject, hit quotas, or land in spam. So the panel never assumes delivery succeeded just because no error was thrown: failures are logged, and a new request can be sent after the cooldown. The honest approach is to tell the user the code was not sent, not to show a “code sent” screen for a message that never arrived.