Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
class ForgotPasswordController extends Controller
{

protected $redirectTo = 'auth/login';

/*
|--------------------------------------------------------------------------
| Password Reset Controller
Expand Down Expand Up @@ -99,21 +97,19 @@ public function showLinkRequestForm() : View
/**
* Send a reset link to the given user.
*
* @param Request $r
* @param Request $request
*
* @return RedirectResponse
*
* @throws
*/
public function sendResetLinkEmail( Request $r ): RedirectResponse
public function sendResetLinkEmail( Request $request ): RedirectResponse
{
$this->validate( $r, ['username' => 'required'] );
$this->validate( $request, ['username' => 'required'] );

// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$r->only('username')
$request->only('username')
);

return $response === Password::RESET_LINK_SENT
Expand All @@ -129,8 +125,8 @@ public function sendResetLinkEmail( Request $r ): RedirectResponse
*/
protected function sendResetLinkResponse(): RedirectResponse
{
AlertContainer::push( 'If your email matches user(s) on the system, then an email listing those users has been sent to you.', Alert::INFO );
return redirect( route( 'login@login' ) );
AlertContainer::push( 'If your username exists on the system, then a password reset link has been sent to you.', Alert::INFO );
return redirect( route( 'login@showForm' ) );
}

/**
Expand All @@ -140,8 +136,8 @@ protected function sendResetLinkResponse(): RedirectResponse
*/
protected function sendResetLinkFailedResponse(): RedirectResponse
{
AlertContainer::push( 'If your email matches user(s) on the system, then an email listing those users has been sent to you.', Alert::INFO );
return redirect( route( 'login@login' ) );
AlertContainer::push( 'If your username exists on the system, then a password reset link has been sent to you.', Alert::INFO );
return redirect( route( 'login@showForm' ) );
}

/**
Expand Down
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,6 @@
<code><![CDATA[User::AUTH_CUSTUSER]]></code>
</RedundantCondition>
</file>
<file src="app/Http/Controllers/Auth/ForgotPasswordController.php">
<MissingDocblockType>
<code><![CDATA[public function sendResetLinkEmail( Request $r ): RedirectResponse]]></code>
</MissingDocblockType>
</file>
<file src="app/Http/Controllers/Auth/LoginController.php">
<MissingDocblockType>
<code><![CDATA[public function peeringdbHandleProviderCallback( Request $r ): RedirectResponse]]></code>
Expand Down
Loading