@@ 12-87 (lines=76) @@ | ||
9 | use App\Http\Controllers\Controller; |
|
10 | use Illuminate\Foundation\Auth\ResetsPasswords; |
|
11 | ||
12 | class ResetPasswordController extends Controller |
|
13 | { |
|
14 | protected $redirectTo = '/blender'; |
|
15 | ||
16 | use ResetsPasswords; |
|
17 | ||
18 | /** |
|
19 | * Create a new controller instance. |
|
20 | */ |
|
21 | public function __construct() |
|
22 | { |
|
23 | $this->middleware('guest'); |
|
24 | } |
|
25 | ||
26 | /** |
|
27 | * Display the password reset view for the given token. |
|
28 | * |
|
29 | * If no token is present, display the link request form. |
|
30 | * |
|
31 | * @param \Illuminate\Http\Request $request |
|
32 | * @param string|null $token |
|
33 | * |
|
34 | * @return \Illuminate\Http\Response |
|
35 | */ |
|
36 | public function showResetForm(Request $request, $token = null) |
|
37 | { |
|
38 | if (! $user = User::findByToken($token)) { |
|
39 | flash()->error(trans('passwordReset.invalidToken')); |
|
40 | ||
41 | return redirect()->to(login_url()); |
|
42 | } |
|
43 | ||
44 | return view('back.auth.resetPassword')->with( |
|
45 | ['token' => $token, 'email' => $request->email, 'user' => $user] |
|
46 | ); |
|
47 | } |
|
48 | ||
49 | /** |
|
50 | * Get the response for a successful password reset. |
|
51 | * |
|
52 | * @param string $response |
|
53 | * |
|
54 | * @return \Illuminate\Http\Response |
|
55 | */ |
|
56 | protected function sendResetResponse($response) |
|
57 | { |
|
58 | flash()->info(trans($response)); |
|
59 | ||
60 | return redirect($this->redirectPath()); |
|
61 | } |
|
62 | ||
63 | protected function guard() |
|
64 | { |
|
65 | return Auth::guard('back'); |
|
66 | } |
|
67 | ||
68 | /** |
|
69 | * Get the broker to be used during password reset. |
|
70 | * |
|
71 | * @return \Illuminate\Contracts\Auth\PasswordBroker |
|
72 | */ |
|
73 | public function broker() |
|
74 | { |
|
75 | return Password::broker('back'); |
|
76 | } |
|
77 | } |
|
78 |
@@ 12-88 (lines=77) @@ | ||
9 | use App\Http\Controllers\Controller; |
|
10 | use Illuminate\Foundation\Auth\ResetsPasswords; |
|
11 | ||
12 | class ResetPasswordController extends Controller |
|
13 | { |
|
14 | protected $redirectTo = '/'; |
|
15 | ||
16 | use ResetsPasswords; |
|
17 | ||
18 | /** |
|
19 | * Create a new controller instance. |
|
20 | */ |
|
21 | public function __construct() |
|
22 | { |
|
23 | $this->middleware('guest'); |
|
24 | } |
|
25 | ||
26 | /** |
|
27 | * Display the password reset view for the given token. |
|
28 | * |
|
29 | * If no token is present, display the link request form. |
|
30 | * |
|
31 | * @param \Illuminate\Http\Request $request |
|
32 | * @param string|null $token |
|
33 | * |
|
34 | * @return \Illuminate\Http\Response |
|
35 | */ |
|
36 | public function showResetForm(Request $request, $token = null) |
|
37 | { |
|
38 | if (! $user = User::findByToken($token)) { |
|
39 | flash()->error(trans('passwordReset.invalidToken')); |
|
40 | ||
41 | return redirect()->to(login_url()); |
|
42 | } |
|
43 | ||
44 | return view('front.auth.resetPassword')->with( |
|
45 | ['token' => $token, 'email' => $request->email, 'user' => $user] |
|
46 | ); |
|
47 | } |
|
48 | ||
49 | /** |
|
50 | * Get the response for a successful password reset. |
|
51 | * |
|
52 | * @param string $response |
|
53 | * |
|
54 | * @return \Illuminate\Http\Response |
|
55 | */ |
|
56 | protected function sendResetResponse($response) |
|
57 | { |
|
58 | flash()->info(trans($response)); |
|
59 | ||
60 | return redirect($this->redirectPath()); |
|
61 | } |
|
62 | ||
63 | protected function guard() |
|
64 | { |
|
65 | return Auth::guard('front'); |
|
66 | } |
|
67 | ||
68 | /** |
|
69 | * Get the broker to be used during password reset. |
|
70 | * |
|
71 | * @return \Illuminate\Contracts\Auth\PasswordBroker |
|
72 | */ |
|
73 | public function broker() |
|
74 | { |
|
75 | return Password::broker('front'); |
|
76 | } |
|
77 | } |
|
78 |