2019-07-17 06:15:25 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-07-17 06:15:25 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-07-17 06:15:25 +02:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Auth;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
2020-10-28 11:10:49 +01:00
|
|
|
use Illuminate\Contracts\View\Factory;
|
2019-07-17 06:15:25 +02:00
|
|
|
use Illuminate\Foundation\Auth\ResetsPasswords;
|
2019-07-18 01:45:18 +02:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
use Illuminate\Support\Facades\Password;
|
2020-10-28 11:10:49 +01:00
|
|
|
use Illuminate\View\View;
|
2019-07-17 06:15:25 +02:00
|
|
|
|
|
|
|
class ContactResetPasswordController extends Controller
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Where to redirect users after resetting their password.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2019-07-18 01:45:18 +02:00
|
|
|
protected $redirectTo = '/client/dashboard';
|
2019-07-17 06:15:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new controller instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
2019-07-18 01:45:18 +02:00
|
|
|
$this->middleware('guest:contact');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display the password reset view for the given token.
|
|
|
|
*
|
|
|
|
* If no token is present, display the link request form.
|
|
|
|
*
|
2020-10-28 11:10:49 +01:00
|
|
|
* @param Request $request
|
2019-07-18 01:45:18 +02:00
|
|
|
* @param string|null $token
|
2020-10-28 11:10:49 +01:00
|
|
|
* @return Factory|View
|
2019-07-18 01:45:18 +02:00
|
|
|
*/
|
|
|
|
public function showResetForm(Request $request, $token = null)
|
|
|
|
{
|
2020-03-23 18:10:42 +01:00
|
|
|
return $this->render('auth.passwords.reset')->with(
|
2019-07-18 01:45:18 +02:00
|
|
|
['token' => $token, 'email' => $request->email]
|
|
|
|
);
|
2019-07-17 06:15:25 +02:00
|
|
|
}
|
2019-07-17 06:52:54 +02:00
|
|
|
|
|
|
|
protected function guard()
|
|
|
|
{
|
|
|
|
return Auth::guard('contact');
|
|
|
|
}
|
2019-07-18 01:45:18 +02:00
|
|
|
|
2019-07-19 06:32:51 +02:00
|
|
|
public function broker()
|
2019-07-18 01:45:18 +02:00
|
|
|
{
|
2019-12-30 22:59:12 +01:00
|
|
|
return Password::broker('contacts');
|
2019-07-18 01:45:18 +02:00
|
|
|
}
|
2019-07-17 06:15:25 +02:00
|
|
|
}
|