.. include:: /Includes.rst.txt .. _feature-1791189887: ===================================== Feature: Log in with a code by e-mail ===================================== Description =========== When a company requires a second factor for everyone and allows ``emailCode`` in its security settings, a user without an authenticator who holds neither ``hr`` nor ``admin`` receives a six-digit code by e-mail after the password. The code is valid 10 minutes, works once, is void after five wrong entries and holds no link; at most three codes are sent in 15 minutes. Apps request it with ``sendLoginEmailCode`` and pass it to ``createToken`` as ``emailCode``; without it the token answers 401 with ``/problems/email-code-required``. Codes are stored hashed in the database, so any application server accepts them. Impact ====== New table ``login_email_code``. .. index:: API, Database, package:adsum-core