1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-07-30 21:00:13 +02:00

Extract TTL in seconds of (email) confirmation requests into constant

This commit is contained in:
Marco
2017-08-07 18:51:21 +02:00
parent 91f50a80bb
commit b7a47fc707

View File

@@ -26,6 +26,7 @@ abstract class UserManager {
const THROTTLE_ACTION_LOGIN = 'login';
const THROTTLE_ACTION_REGISTER = 'register';
const THROTTLE_ACTION_CONSUME_TOKEN = 'confirm_email';
const CONFIRMATION_REQUESTS_TTL_IN_SECONDS = 60 * 60 * 24;
/** @var PdoDatabase the database connection to operate on */
protected $db;
@@ -282,7 +283,7 @@ abstract class UserManager {
$tokenHashed = password_hash($token, PASSWORD_DEFAULT);
// the request shall be valid for one day
$expires = time() + 60 * 60 * 24;
$expires = time() + self::CONFIRMATION_REQUESTS_TTL_IN_SECONDS;
try {
$this->db->insert(