web: ensure that login token is valid for 24 hours

This commit is contained in:
David Anderson 2018-07-13 19:35:20 -07:00
parent 80a2cae9b7
commit c8aa75b5ef
1 changed files with 1 additions and 0 deletions

View File

@ -26,6 +26,7 @@
function make_login_token($user) {
$now = time();
if ($now - $user->login_token_time < 86400) {
$user->update("login_token_time=$now");
return $user->login_token;
}
$token = substr(random_string(), 0, 8);