From 7fbe2f5e309029769f6d1aea082e7831c1c01013 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 21 Dec 2017 17:23:45 -0600 Subject: [PATCH] cleanup and ensure forgot password functionality is working --- Procfile | 1 + .../Auth/ForgotPasswordController.php | 26 +++------------- app/Http/Controllers/Auth/LoginController.php | 31 +++---------------- .../Controllers/Auth/RegisterController.php | 21 +++++-------- .../Auth/ResetPasswordController.php | 12 ++----- .../layouts/default/auth/login.blade.php | 2 +- 6 files changed, 22 insertions(+), 71 deletions(-) diff --git a/Procfile b/Procfile index 9023b9fe..1729d537 100644 --- a/Procfile +++ b/Procfile @@ -2,3 +2,4 @@ dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground php-fpm: /usr/local/sbin/php-fpm --nodaemonize nginx: /usr/local/bin/nginx mysql: /usr/local/bin/mysqld +mailhog: /usr/local/bin/mailhog diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index e11ac074..d95f3b4b 100755 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -7,31 +7,15 @@ use Illuminate\Foundation\Auth\SendsPasswordResetEmails; class ForgotPasswordController extends Controller { - /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset emails and - | includes a trait which assists in sending these notifications from - | your application to your users. Feel free to explore this trait. - | - */ - use SendsPasswordResetEmails; + public function __construct() + { + $this->middleware('guest'); + } + public function showLinkRequestForm() { return $this->view('auth.passwords.email'); } - - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - $this->middleware('guest'); - } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index e98bbd78..63a01e03 100755 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -7,38 +7,17 @@ use Illuminate\Foundation\Auth\AuthenticatesUsers; class LoginController extends Controller { - /* - |-------------------------------------------------------------------------- - | Login Controller - |-------------------------------------------------------------------------- - | - | This controller handles authenticating users for the application and - | redirecting them to your home screen. The controller uses a trait - | to conveniently provide its functionality to your applications. - | - */ - use AuthenticatesUsers; - /** - * Where to redirect users after login / registration. - * - * @var string - */ protected $redirectTo = '/dashboard'; + public function __construct() + { + $this->middleware('guest', ['except' => 'logout']); + } + public function showLoginForm() { return $this->view('auth/login'); } - - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - $this->middleware('guest', ['except' => 'logout']); - } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 57629e23..c5fd37ec 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -23,6 +23,14 @@ class RegisterController extends Controller protected $userService; + + public function __construct( + UserService $userService + ) { + $this->userService = $userService; + $this->middleware('guest'); + } + public function showRegistrationForm() { $airports = Airport::all(); @@ -33,19 +41,6 @@ class RegisterController extends Controller ]); } - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct( - UserService $userService - ) - { - $this->userService = $userService; - $this->middleware('guest'); - } - /** * Get a validator for an incoming registration request. * diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 1c748ac5..95e61afa 100755 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -2,21 +2,13 @@ namespace App\Http\Controllers\Auth; +use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController 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. - | - */ + protected $redirectTo = '/login'; use ResetsPasswords; diff --git a/resources/views/layouts/default/auth/login.blade.php b/resources/views/layouts/default/auth/login.blade.php index 3ddc6540..bcc4b845 100644 --- a/resources/views/layouts/default/auth/login.blade.php +++ b/resources/views/layouts/default/auth/login.blade.php @@ -55,7 +55,7 @@
- Need Help? + Forgot Password?