Skip to content

Commit 3e8514b

Browse files
authored
Merge pull request pterodactyl#768 from Pterodactyl/feature/auth-controller-cleanup
Push updates to login page, mostly UI enhancements.
2 parents 699f0df + 6f52f4a commit 3e8514b

File tree

13 files changed

+421
-434
lines changed

13 files changed

+421
-434
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1919
### Changed
2020
* Moved Docker image setting to be on the startup management page for a server rather than the details page. This value changes based on the Nest and Egg that are selected.
2121
* Two-Factor authentication tokens are now 32 bytes in length, and are stored encrypted at rest in the database.
22+
* Login page UI has been improved to be more sleek and welcoming to users.
23+
* Changed 2FA login process to be more secure. Previously authentication checking happened on the 2FA post page, now it happens prior and is passed along to the 2FA page to avoid storing any credentials.
2224

2325
### Added
2426
* Socketio error messages due to permissions are now rendered correctly in the UI rather than causing a silent failure.

app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,31 @@
11
<?php
2-
/**
3-
* Pterodactyl - Panel
4-
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5-
*
6-
* This software is licensed under the terms of the MIT license.
7-
* https://opensource.org/licenses/MIT
8-
*/
92

103
namespace Pterodactyl\Http\Controllers\Auth;
114

125
use Illuminate\Http\Request;
6+
use Illuminate\Http\RedirectResponse;
137
use Illuminate\Support\Facades\Password;
148
use Pterodactyl\Http\Controllers\Controller;
159
use Pterodactyl\Events\Auth\FailedPasswordReset;
1610
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
1711

1812
class ForgotPasswordController extends Controller
1913
{
20-
/*
21-
|--------------------------------------------------------------------------
22-
| Password Reset Controller
23-
|--------------------------------------------------------------------------
24-
|
25-
| This controller is responsible for handling password reset emails and
26-
| includes a trait which assists in sending these notifications from
27-
| your application to your users. Feel free to explore this trait.
28-
|
29-
*/
30-
3114
use SendsPasswordResetEmails;
3215

33-
/**
34-
* Create a new controller instance.
35-
*/
36-
public function __construct()
37-
{
38-
$this->middleware('guest');
39-
}
40-
4116
/**
4217
* Get the response for a failed password reset link.
4318
*
4419
* @param \Illuminate\Http\Request
4520
* @param string $response
4621
* @return \Illuminate\Http\RedirectResponse
4722
*/
48-
protected function sendResetLinkFailedResponse(Request $request, $response)
23+
protected function sendResetLinkFailedResponse(Request $request, $response): RedirectResponse
4924
{
5025
// As noted in #358 we will return success even if it failed
5126
// to avoid pointing out that an account does or does not
5227
// exist on the system.
53-
event(new FailedPasswordReset($request->ip(), $request->only('email')));
28+
event(new FailedPasswordReset($request->ip(), $request->input('email')));
5429

5530
return $this->sendResetLinkResponse(Password::RESET_LINK_SENT);
5631
}

0 commit comments

Comments
 (0)