koel/app/Http/Controllers/API/ResetPasswordController.php
2024-07-06 17:44:47 +02:00

20 lines
595 B
PHP

<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use App\Http\Requests\API\ResetPasswordRequest;
use App\Services\AuthenticationService;
use Illuminate\Http\Response;
class ResetPasswordController extends Controller
{
public function __invoke(ResetPasswordRequest $request, AuthenticationService $auth)
{
static::disableInDemo();
return $auth->tryResetPasswordUsingBroker($request->email, $request->password, $request->token)
? response()->noContent()
: response('', Response::HTTP_UNPROCESSABLE_ENTITY);
}
}