Fix password reset system

This commit is contained in:
Dane Everitt 2016-01-16 21:57:10 -05:00
parent 8e92f96999
commit 861af87e93
7 changed files with 11 additions and 14 deletions

View file

@ -22,6 +22,7 @@ MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null
MAIL_ENCRYPTION=null MAIL_ENCRYPTION=null
MAIL_FROM=you@example.com
API_PREFIX=api API_PREFIX=api
API_VERSION=v1 API_VERSION=v1

View file

@ -19,6 +19,7 @@ class PasswordController extends Controller
*/ */
use ResetsPasswords; use ResetsPasswords;
protected $redirectTo = '/'; protected $redirectTo = '/';
/** /**

View file

@ -35,26 +35,21 @@ class AuthRoutes {
// Show Password Reset Form // Show Password Reset Form
$router->get('password', [ $router->get('password', [
'as' => 'auth.password',
'uses' => 'Auth\PasswordController@getEmail' 'uses' => 'Auth\PasswordController@getEmail'
]); ]);
// Handle Password Reset // Handle Password Reset
$router->post('password', [ $router->post('password', [
'as' => 'auth.password.submit',
'uses' => 'Auth\PasswordController@postEmail' 'uses' => 'Auth\PasswordController@postEmail'
], function () { ]);
return redirect('auth/password')->with('sent', true);
});
// Show Verification Checkpoint // Show Verification Checkpoint
$router->get('password/verify/{token}', [ $router->get('password/reset/{token}', [
'as' => 'auth.verify',
'uses' => 'Auth\PasswordController@getReset' 'uses' => 'Auth\PasswordController@getReset'
]); ]);
// Handle Verification // Handle Verification
$router->post('password/verify', [ $router->post('password/reset', [
'uses' => 'Auth\PasswordController@postReset' 'uses' => 'Auth\PasswordController@postReset'
]); ]);

View file

@ -54,7 +54,7 @@ return [
| |
*/ */
'from' => ['address' => null, 'name' => null], 'from' => ['address' => env('MAIL_FROM'), 'name' => env('MAIL_FROM_NAME', 'Pterodactyl Panel')],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View file

@ -10,7 +10,7 @@
@endsection @endsection
@section('content') @section('content')
<div class="col-md-6"> <div class="col-md-8">
<form action="/auth/password" method="POST"> <form action="/auth/password" method="POST">
<legend>{{ trans('auth.resetpassword') }}</legend> <legend>{{ trans('auth.resetpassword') }}</legend>
<fieldset> <fieldset>

View file

@ -10,8 +10,8 @@
@endsection @endsection
@section('content') @section('content')
<div class="col-md-6"> <div class="col-md-8">
<form action="/auth/password/verify" method="POST"> <form action="/auth/password/reset" method="POST">
<legend>{{ trans('auth.resetpassword') }}</legend> <legend>{{ trans('auth.resetpassword') }}</legend>
<fieldset> <fieldset>
<input type="hidden" name="token" value="{{ $token }}"> <input type="hidden" name="token" value="{{ $token }}">

View file

@ -7,8 +7,8 @@
<center><h1>Pterodactyl Lost Password Recovery</h1></center> <center><h1>Pterodactyl Lost Password Recovery</h1></center>
<p>Hello there! You are receiving this email because you requested a new password for your Pterodactyl account.</p> <p>Hello there! You are receiving this email because you requested a new password for your Pterodactyl account.</p>
<p>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. <strong>This link will expire in 1 hour.</strong></p> <p>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. <strong>This link will expire in 1 hour.</strong></p>
<p><a href="{{ url('auth/password/verify/'.$token) }}">{{ url('auth/password/verify/'.$token) }}</a></p> <p><a href="{{ url('auth/password/reset/'.$token) }}">{{ url('auth/password/reset/'.$token) }}</a></p>
<p>Please do not hesitate to contact us if you belive something is wrong. <p>Please do not hesitate to contact us if you belive something is wrong.
<p>Thanks!<br />Pterodactyl</p> <p>Thanks!<br />Pterodactyl</p>
</body> </body>
</html> </html>