mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
fixed more attributes to match beta 8
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Flarum\Http\Middleware;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Flarum\Http\AccessToken;
|
||||
use Flarum\User\AuthToken;
|
||||
use Flarum\User\EmailToken;
|
||||
@@ -54,9 +55,11 @@ class CollectGarbage implements MiddlewareInterface
|
||||
return;
|
||||
}
|
||||
|
||||
AccessToken::whereRaw('last_activity <= ? - lifetime', [time()])->delete();
|
||||
$time = Carbon::now()->timestamp;
|
||||
|
||||
$earliestToKeep = date('Y-m-d H:i:s', time() - 24 * 60 * 60);
|
||||
AccessToken::whereRaw('last_activity <= ? - lifetime', [$time])->delete();
|
||||
|
||||
$earliestToKeep = date('Y-m-d H:i:s', $time - 24 * 60 * 60);
|
||||
|
||||
EmailToken::where('created_at', '<=', $earliestToKeep)->delete();
|
||||
PasswordToken::where('created_at', '<=', $earliestToKeep)->delete();
|
||||
|
Reference in New Issue
Block a user