Remove repositories and replace usages
This commit is contained in:
parent
860b2d890b
commit
369c61f1a8
11 changed files with 49 additions and 93 deletions
|
@ -12,7 +12,6 @@ use Pterodactyl\Exceptions\DisplayException;
|
|||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Pterodactyl\Http\Requests\Auth\ResetPasswordRequest;
|
||||
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
|
@ -30,8 +29,7 @@ class ResetPasswordController extends Controller
|
|||
*/
|
||||
public function __construct(
|
||||
private Dispatcher $dispatcher,
|
||||
private Hasher $hasher,
|
||||
private UserRepositoryInterface $userRepository
|
||||
private Hasher $hasher
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -75,10 +73,9 @@ class ResetPasswordController extends Controller
|
|||
*/
|
||||
protected function resetPassword($user, $password)
|
||||
{
|
||||
$user = $this->userRepository->update($user->id, [
|
||||
'password' => $this->hasher->make($password),
|
||||
$user->getRememberTokenName() => Str::random(60),
|
||||
]);
|
||||
$user->password = $this->hasher->make($password);
|
||||
$user->setRememberToken(Str::random(60));
|
||||
$user->save();
|
||||
|
||||
$this->dispatcher->dispatch(new PasswordReset($user));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue