Match original database password length when doing a password reset (#1509)

This commit is contained in:
Arnaud Lier 2019-03-23 22:04:57 +01:00 committed by Dane Everitt
parent fa4858f292
commit 4460b6835a
3 changed files with 3 additions and 3 deletions

View file

@ -599,7 +599,7 @@ class ServersController extends Controller
['id', '=', $request->input('database')], ['id', '=', $request->input('database')],
]); ]);
$this->databasePasswordService->handle($database, str_random(20)); $this->databasePasswordService->handle($database, str_random(24));
return response('', 204); return response('', 204);
} }

View file

@ -142,7 +142,7 @@ class DatabaseController extends Controller
{ {
$this->authorize('reset-db-password', $request->attributes->get('server')); $this->authorize('reset-db-password', $request->attributes->get('server'));
$password = str_random(20); $password = str_random(24);
$this->passwordService->handle($request->attributes->get('database'), $password); $this->passwordService->handle($request->attributes->get('database'), $password);
return response()->json(['password' => $password]); return response()->json(['password' => $password]);

View file

@ -69,7 +69,7 @@ class DatabaseManagementService
$data['server_id'] = $server; $data['server_id'] = $server;
$data['database'] = sprintf('s%d_%s', $server, $data['database']); $data['database'] = sprintf('s%d_%s', $server, $data['database']);
$data['username'] = sprintf('u%d_%s', $server, str_random(10)); $data['username'] = sprintf('u%d_%s', $server, str_random(10));
$data['password'] = $this->encrypter->encrypt(str_random(16)); $data['password'] = $this->encrypter->encrypt(str_random(24));
$this->database->beginTransaction(); $this->database->beginTransaction();
try { try {