Skip to content

Commit 861af87

Browse files
committed
Fix password reset system
1 parent 8e92f96 commit 861af87

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ MAIL_PORT=2525
2222
MAIL_USERNAME=null
2323
MAIL_PASSWORD=null
2424
MAIL_ENCRYPTION=null
25+
MAIL_FROM=you@example.com
2526

2627
API_PREFIX=api
2728
API_VERSION=v1

app/Http/Controllers/Auth/PasswordController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class PasswordController extends Controller
1919
*/
2020

2121
use ResetsPasswords;
22+
2223
protected $redirectTo = '/';
2324

2425
/**

app/Http/Routes/AuthRoutes.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,21 @@ public function map(Router $router) {
3535

3636
// Show Password Reset Form
3737
$router->get('password', [
38-
'as' => 'auth.password',
3938
'uses' => 'Auth\PasswordController@getEmail'
4039
]);
4140

4241
// Handle Password Reset
4342
$router->post('password', [
44-
'as' => 'auth.password.submit',
4543
'uses' => 'Auth\PasswordController@postEmail'
46-
], function () {
47-
return redirect('auth/password')->with('sent', true);
48-
});
44+
]);
4945

5046
// Show Verification Checkpoint
51-
$router->get('password/verify/{token}', [
52-
'as' => 'auth.verify',
47+
$router->get('password/reset/{token}', [
5348
'uses' => 'Auth\PasswordController@getReset'
5449
]);
5550

5651
// Handle Verification
57-
$router->post('password/verify', [
52+
$router->post('password/reset', [
5853
'uses' => 'Auth\PasswordController@postReset'
5954
]);
6055

config/mail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
|
5555
*/
5656

57-
'from' => ['address' => null, 'name' => null],
57+
'from' => ['address' => env('MAIL_FROM'), 'name' => env('MAIL_FROM_NAME', 'Pterodactyl Panel')],
5858

5959
/*
6060
|--------------------------------------------------------------------------

resources/views/auth/password.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@endsection
1111

1212
@section('content')
13-
<div class="col-md-6">
13+
<div class="col-md-8">
1414
<form action="/auth/password" method="POST">
1515
<legend>{{ trans('auth.resetpassword') }}</legend>
1616
<fieldset>

resources/views/auth/reset.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
@endsection
1111

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

resources/views/emails/password.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<center><h1>Pterodactyl Lost Password Recovery</h1></center>
88
<p>Hello there! You are receiving this email because you requested a new password for your Pterodactyl account.</p>
99
<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>
10-
<p><a href="{{ url('auth/password/verify/'.$token) }}">{{ url('auth/password/verify/'.$token) }}</a></p>
10+
<p><a href="{{ url('auth/password/reset/'.$token) }}">{{ url('auth/password/reset/'.$token) }}</a></p>
1111
<p>Please do not hesitate to contact us if you belive something is wrong.
1212
<p>Thanks!<br />Pterodactyl</p>
1313
</body>
14-
</html>
14+
</html>

0 commit comments

Comments
 (0)