Use cache helpers rather than database to handle configuration tokens and downloads.
This commit is contained in:
parent
2330c25a8c
commit
605c91a9af
11 changed files with 95 additions and 146 deletions
|
@ -27,6 +27,7 @@ namespace Pterodactyl\Http\Controllers\Admin;
|
|||
use DB;
|
||||
use Log;
|
||||
use Alert;
|
||||
use Cache;
|
||||
use Javascript;
|
||||
use Pterodactyl\Models;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -364,11 +365,9 @@ class NodesController extends Controller
|
|||
{
|
||||
$node = Models\Node::findOrFail($id);
|
||||
|
||||
$t = Models\NodeConfigurationToken::create([
|
||||
'node_id' => $id,
|
||||
'token' => str_random(32),
|
||||
]);
|
||||
$token = str_random(32);
|
||||
Cache::put('NodeConfiguration:' . $token, $node->id, 5);
|
||||
|
||||
return response()->json(['token' => $t->token]);
|
||||
return response()->json(['token' => $token]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue