2015-07-12 21:01:42 +02:00
|
|
|
<?php
|
|
|
|
|
2015-09-10 20:31:09 +02:00
|
|
|
namespace BookStack\Http\Controllers\Auth;
|
2015-07-12 21:01:42 +02:00
|
|
|
|
2015-09-10 20:31:09 +02:00
|
|
|
use BookStack\Http\Controllers\Controller;
|
2015-07-12 21:01:42 +02:00
|
|
|
use Illuminate\Foundation\Auth\ResetsPasswords;
|
2019-09-07 00:36:16 +02:00
|
|
|
use Illuminate\Http\Request;
|
2015-07-12 21:01:42 +02:00
|
|
|
|
2016-09-17 19:22:04 +02:00
|
|
|
class ResetPasswordController extends Controller
|
2015-07-12 21:01:42 +02:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Password Reset Controller
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| This controller is responsible for handling password reset requests
|
|
|
|
| and uses a simple trait to include this behavior. You're free to
|
|
|
|
| explore this trait and override any methods you wish to tweak.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
use ResetsPasswords;
|
|
|
|
|
2016-11-12 12:40:54 +01:00
|
|
|
protected $redirectTo = '/';
|
|
|
|
|
2015-07-12 21:01:42 +02:00
|
|
|
/**
|
2016-09-17 19:22:04 +02:00
|
|
|
* Create a new controller instance.
|
|
|
|
*
|
|
|
|
* @return void
|
2015-07-12 21:01:42 +02:00
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->middleware('guest');
|
2020-02-02 14:10:21 +01:00
|
|
|
$this->middleware('guard:standard');
|
2016-09-17 19:22:04 +02:00
|
|
|
parent::__construct();
|
2015-07-12 21:01:42 +02:00
|
|
|
}
|
2016-11-12 12:40:54 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the response for a successful password reset.
|
|
|
|
*
|
2019-09-07 00:36:16 +02:00
|
|
|
* @param Request $request
|
|
|
|
* @param string $response
|
2016-11-12 12:40:54 +01:00
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
2019-09-07 00:36:16 +02:00
|
|
|
protected function sendResetResponse(Request $request, $response)
|
2016-11-12 12:40:54 +01:00
|
|
|
{
|
2016-12-04 17:51:39 +01:00
|
|
|
$message = trans('auth.reset_password_success');
|
2019-10-05 13:55:01 +02:00
|
|
|
$this->showSuccessNotification($message);
|
2016-11-12 12:40:54 +01:00
|
|
|
return redirect($this->redirectPath())
|
|
|
|
->with('status', trans($response));
|
|
|
|
}
|
2018-01-28 17:58:52 +01:00
|
|
|
}
|