mirror of
https://github.com/koel/koel
synced 2024-12-24 11:33:05 +00:00
20 lines
595 B
PHP
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);
|
|
}
|
|
}
|