Commit cf84578c authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added option to prevent confirmation key one time use

parent 2d117daa
Pipeline #9321 passed with stage
in 2 minutes and 40 seconds
......@@ -99,4 +99,11 @@ define("EXPIRATION_DELAY", 180);
*/
define ("INVALID_CONFIRMATION_KEY", "ERROR");
/*
* Update confirmation key to INVALID_CONFIRMATION_KEY after correct use
*
* Default value: TRUE
*/
define("REMOVE_CONFIRMATION_KEY_AFTER_USE", TRUE);
?>
......@@ -141,9 +141,11 @@ function is_key_matching($key, $account) {
return false;
}
// Key is one time only
$account->confirmation_key = INVALID_CONFIRMATION_KEY;
$account->update();
if (REMOVE_CONFIRMATION_KEY_AFTER_USE) {
// Key is one time only
$account->confirmation_key = INVALID_CONFIRMATION_KEY;
$account->update();
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment