Remove useless overrides since json is the default response format

This commit is contained in:
Bubka 2021-10-01 13:37:44 +02:00
parent 77cf15cf5e
commit 1a51cf967a
4 changed files with 0 additions and 95 deletions

View File

@ -31,30 +31,4 @@ protected function validateEmail(Request $request)
{
$request->validate(['email' => 'required|exists:users,email']);
}
/**
* Get the response for a successful password reset link.
*
* @param \Illuminate\Http\Request $request
* @param string $response
* @return \Illuminate\Http\RedirectResponse
*/
protected function sendResetLinkResponse(Request $request, $response)
{
return ['status' => trans($response)];
}
/**
* Get the response for a failed password reset link.
*
* @param \Illuminate\Http\Request $request
* @param string $response
* @return \Illuminate\Http\RedirectResponse
*
* @codeCoverageIgnore Can't find how to test this :/
*/
protected function sendResetLinkFailedResponse(Request $request, $response)
{
return response()->json(['requestFailed' => trans($response)], 400);
}
}

View File

@ -126,22 +126,6 @@ protected function credentials(Request $request)
}
/**
* Validate the user login request.
*
* @param \Illuminate\Http\Request $request
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
protected function validateLogin(Request $request)
{
$request->validate([
$this->username() => 'required|email|exists:users,email',
'password' => 'required|string',
]);
}
/**
* The user has been authenticated.
*
@ -154,18 +138,4 @@ protected function authenticated(Request $request, $user)
$user->last_seen_at = Carbon::now()->format('Y-m-d H:i:s');
$user->save();
}
/**
* log out current user
* @param Request $request
* @return \Illuminate\Http\JsonResponse
*/
public function logout(Request $request)
{
$accessToken = Auth::user()->token();
$accessToken->revoke();
return response()->json(['message' => 'signed out'], Response::HTTP_OK);
}
}

View File

@ -65,20 +65,6 @@ public function register(Request $request)
]);
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.

View File

@ -21,29 +21,4 @@ class ResetPasswordController extends Controller
use ResetsPasswords;
/**
* Get the response for a successful password reset.
*
* @param \Illuminate\Http\Request $request
* @param string $response
* @return \Illuminate\Http\RedirectResponse
*/
protected function sendResetResponse(Request $request, $response)
{
return ['status' => trans($response)];
}
/**
* Get the response for a failed password reset.
*
* @param \Illuminate\Http\Request $request
* @param string $response
* @return \Illuminate\Http\RedirectResponse
*
* @codeCoverageIgnore Can't find how to test this :/
*/
protected function sendResetFailedResponse(Request $request, $response)
{
return response()->json(['resetFailed' => trans($response)], 400);
}
}