Skip to content

[1.x] Added reset password redirect url #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions config/fortify.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'password-confirmation' => null,
'register' => null,
'email-verification' => null,
'password-reset' => null,
],
'features' => [
Features::registration(),
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Responses/PasswordResetResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Http\JsonResponse;
use Laravel\Fortify\Contracts\PasswordResetResponse as PasswordResetResponseContract;
use Laravel\Fortify\Fortify;

class PasswordResetResponse implements PasswordResetResponseContract
{
Expand Down Expand Up @@ -35,6 +36,6 @@ public function toResponse($request)
{
return $request->wantsJson()
? new JsonResponse(['message' => trans($this->status)], 200)
: redirect()->route('login')->with('status', trans($this->status));
: redirect(Fortify::redirects('password-reset'))->with('status', trans($this->status));
}
}
5 changes: 3 additions & 2 deletions tests/NewPasswordControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Support\Facades\Password;
use Laravel\Fortify\Contracts\ResetPasswordViewResponse;
use Laravel\Fortify\Contracts\ResetsUserPasswords;
use Laravel\Fortify\Fortify;
use Mockery;

class NewPasswordControllerTest extends OrchestraTestCase
Expand Down Expand Up @@ -54,7 +55,7 @@ public function test_password_can_be_reset()
]);

$response->assertStatus(302);
$response->assertRedirect('/login');
$response->assertRedirect(Fortify::redirects('password-reset'));
}

public function test_password_reset_can_fail()
Expand Down Expand Up @@ -125,7 +126,7 @@ public function test_password_can_be_reset_with_customized_email_address_field()
]);

$response->assertStatus(302);
$response->assertRedirect('/login');
$response->assertRedirect(Fortify::redirects('password-reset'));
}

public function test_password_is_required()
Expand Down