Parent Issue / 親Issue
#405
Motivation / 目的
Implement the Presentation layer for the User Login API.
ユーザーログインAPIのPresentation層を実装します。
What to do / 実施内容
LoginRequest.php: フォームリクエスト(email・password のバリデーション)
AuthController.php: LoginUseCase を呼び出してレスポンスを返す
- 200: 認証成功(token を含む)
- 401: 認証失敗(
InvalidCredentialsException)
- 500: その他エラー(
Log::error)
AuthResource.php: レスポンスの整形
- Route:
POST /api/v1/user/login
Tests / テスト
test_login_returns_200_with_token_when_credentials_are_valid
test_login_returns_401_when_credentials_are_invalid
test_login_returns_422_when_request_is_invalid
Parent Issue / 親Issue
#405
Motivation / 目的
Implement the Presentation layer for the User Login API.
ユーザーログインAPIのPresentation層を実装します。
What to do / 実施内容
LoginRequest.php: フォームリクエスト(email・password のバリデーション)AuthController.php:LoginUseCaseを呼び出してレスポンスを返すInvalidCredentialsException)Log::error)AuthResource.php: レスポンスの整形POST /api/v1/user/loginTests / テスト
test_login_returns_200_with_token_when_credentials_are_validtest_login_returns_401_when_credentials_are_invalidtest_login_returns_422_when_request_is_invalid