2016-09-03 21:09:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Controllers\Auth;
|
|
|
|
|
2017-03-30 21:44:20 +00:00
|
|
|
use Illuminate\Http\Request;
|
2017-11-18 21:09:58 +00:00
|
|
|
use Illuminate\Http\RedirectResponse;
|
2017-03-30 21:44:20 +00:00
|
|
|
use Illuminate\Support\Facades\Password;
|
2016-09-03 21:09:00 +00:00
|
|
|
use Pterodactyl\Http\Controllers\Controller;
|
2017-03-30 21:44:20 +00:00
|
|
|
use Pterodactyl\Events\Auth\FailedPasswordReset;
|
2016-09-03 21:09:00 +00:00
|
|
|
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
|
|
|
|
|
|
|
class ForgotPasswordController extends Controller
|
|
|
|
{
|
|
|
|
use SendsPasswordResetEmails;
|
|
|
|
|
2017-03-30 21:44:20 +00:00
|
|
|
/**
|
|
|
|
* Get the response for a failed password reset link.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request
|
2017-08-22 03:10:48 +00:00
|
|
|
* @param string $response
|
2017-03-30 21:44:20 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
|
|
*/
|
2017-11-18 21:09:58 +00:00
|
|
|
protected function sendResetLinkFailedResponse(Request $request, $response): RedirectResponse
|
2017-03-30 21:44:20 +00:00
|
|
|
{
|
|
|
|
// As noted in #358 we will return success even if it failed
|
|
|
|
// to avoid pointing out that an account does or does not
|
|
|
|
// exist on the system.
|
2017-11-18 21:09:58 +00:00
|
|
|
event(new FailedPasswordReset($request->ip(), $request->input('email')));
|
2017-03-30 21:44:20 +00:00
|
|
|
|
|
|
|
return $this->sendResetLinkResponse(Password::RESET_LINK_SENT);
|
|
|
|
}
|
2016-09-03 21:09:00 +00:00
|
|
|
}
|