diff --git a/app/Http/Controllers/Auth/PasswordResetController.php b/app/Http/Controllers/Auth/PasswordResetController.php index 62306fb..5777260 100644 --- a/app/Http/Controllers/Auth/PasswordResetController.php +++ b/app/Http/Controllers/Auth/PasswordResetController.php @@ -19,7 +19,7 @@ public function sendResetLinkEmail(Request $request) $email = $request->email; $reset = PasswordReset::create([ 'email' => $email, - 'token' => str_random(10) + 'token' => str_random(10), ]); $token = $reset->token; @@ -43,9 +43,10 @@ public function verify(Request $request) ->whereToken($request->token) ->first(); - if (!$check) { + if (! $check) { return response()->error('Email does not exist', 422); } + return response()->success(true); } diff --git a/app/PasswordReset.php b/app/PasswordReset.php index 8ac5819..90c7ae1 100644 --- a/app/PasswordReset.php +++ b/app/PasswordReset.php @@ -6,7 +6,6 @@ class PasswordReset extends Model { - protected $fillable = ['email', 'token']; public function setUpdatedAtAttribute($value) diff --git a/tests/PasswordResetTest.php b/tests/PasswordResetTest.php index 6646e2e..9c14c6f 100644 --- a/tests/PasswordResetTest.php +++ b/tests/PasswordResetTest.php @@ -43,7 +43,6 @@ public function testVerifyTokenUnsuccessfully() ->seeValidationError(); } - public function testResetPasswordWithTokenSuccessfully() { $user = factory(App\User::class)->create();