From 861af87e93cf959ee0b6c674788f037751210655 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 16 Jan 2016 21:57:10 -0500 Subject: [PATCH] Fix password reset system --- .env.example | 1 + app/Http/Controllers/Auth/PasswordController.php | 1 + app/Http/Routes/AuthRoutes.php | 11 +++-------- config/mail.php | 2 +- resources/views/auth/password.blade.php | 2 +- resources/views/auth/reset.blade.php | 4 ++-- resources/views/emails/password.blade.php | 4 ++-- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index 6665c4b1a..6e00765ba 100644 --- a/.env.example +++ b/.env.example @@ -22,6 +22,7 @@ MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null +MAIL_FROM=you@example.com API_PREFIX=api API_VERSION=v1 diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 2bdbcc6e3..997ee32db 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -19,6 +19,7 @@ class PasswordController extends Controller */ use ResetsPasswords; + protected $redirectTo = '/'; /** diff --git a/app/Http/Routes/AuthRoutes.php b/app/Http/Routes/AuthRoutes.php index 314ab3dc7..0d50f2c8d 100644 --- a/app/Http/Routes/AuthRoutes.php +++ b/app/Http/Routes/AuthRoutes.php @@ -35,26 +35,21 @@ class AuthRoutes { // Show Password Reset Form $router->get('password', [ - 'as' => 'auth.password', 'uses' => 'Auth\PasswordController@getEmail' ]); // Handle Password Reset $router->post('password', [ - 'as' => 'auth.password.submit', 'uses' => 'Auth\PasswordController@postEmail' - ], function () { - return redirect('auth/password')->with('sent', true); - }); + ]); // Show Verification Checkpoint - $router->get('password/verify/{token}', [ - 'as' => 'auth.verify', + $router->get('password/reset/{token}', [ 'uses' => 'Auth\PasswordController@getReset' ]); // Handle Verification - $router->post('password/verify', [ + $router->post('password/reset', [ 'uses' => 'Auth\PasswordController@postReset' ]); diff --git a/config/mail.php b/config/mail.php index a22807e71..07ea9c147 100644 --- a/config/mail.php +++ b/config/mail.php @@ -54,7 +54,7 @@ return [ | */ - 'from' => ['address' => null, 'name' => null], + 'from' => ['address' => env('MAIL_FROM'), 'name' => env('MAIL_FROM_NAME', 'Pterodactyl Panel')], /* |-------------------------------------------------------------------------- diff --git a/resources/views/auth/password.blade.php b/resources/views/auth/password.blade.php index 9e6d3e01b..4e12df292 100644 --- a/resources/views/auth/password.blade.php +++ b/resources/views/auth/password.blade.php @@ -10,7 +10,7 @@ @endsection @section('content') -
+
{{ trans('auth.resetpassword') }}
diff --git a/resources/views/auth/reset.blade.php b/resources/views/auth/reset.blade.php index 3cbd78db2..a5567f41a 100644 --- a/resources/views/auth/reset.blade.php +++ b/resources/views/auth/reset.blade.php @@ -10,8 +10,8 @@ @endsection @section('content') -
- +
+ {{ trans('auth.resetpassword') }}
diff --git a/resources/views/emails/password.blade.php b/resources/views/emails/password.blade.php index d82308025..b71b1e228 100644 --- a/resources/views/emails/password.blade.php +++ b/resources/views/emails/password.blade.php @@ -7,8 +7,8 @@

Pterodactyl Lost Password Recovery

Hello there! You are receiving this email because you requested a new password for your Pterodactyl account.

Please click the link below to confirm that you wish to change your password. If you did not make this request, or do not wish to continue simply ignore this email and nothing will happen. This link will expire in 1 hour.

-

{{ url('auth/password/verify/'.$token) }}

+

{{ url('auth/password/reset/'.$token) }}

Please do not hesitate to contact us if you belive something is wrong.

Thanks!
Pterodactyl

- \ No newline at end of file +