Skip to content

feat: implement Presentation layer for User Logout / ユーザーログアウトのPresentation層実装#538

Merged
zigzagdev merged 2 commits into
feat/user-logoutfrom
feat/user-logout_presentation-layer
Jul 15, 2026
Merged

feat: implement Presentation layer for User Logout / ユーザーログアウトのPresentation層実装#538
zigzagdev merged 2 commits into
feat/user-logoutfrom
feat/user-logout_presentation-layer

Conversation

@zigzagdev

Copy link
Copy Markdown
Owner

Motivation / 目的

Implement the Presentation layer for POST /api/v1/user/logout to complete the User Logout API.

ユーザーログアウトAPI(POST /api/v1/user/logout)のPresentation層を実装し、ログアウト機能を完成させました。

What I have done / 実施内容

  • AuthController: logout アクションを追加
    • $request->bearerToken() で現在のトークンを取得し LogoutUseCase::handle() に渡す
    • 200: ログアウト成功
    • 401: 未認証(auth:sanctum ミドルウェアが処理)
    • 500: その他エラー(Log::error
  • routes/api.php: POST /v1/user/logoutauth:sanctum ミドルウェア付きで登録
    • login / logout を Route::controller(AuthController::class)->prefix('user') にまとめて整理

Test Results / テスト結果

  • LogoutTest::test_logout_returns_200_when_authenticated
  • LogoutTest::test_logout_returns_401_when_unauthenticated
  • LogoutTest::test_logout_returns_500_on_unexpected_error

Closes #411

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.21%. Comparing base (d2b599f) to head (cd841fb).

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                   @@
##             feat/user-logout     #538      +/-   ##
======================================================
+ Coverage               61.92%   62.21%   +0.28%     
- Complexity               1594     1604      +10     
======================================================
  Files                     134      135       +1     
  Lines                    8190     8252      +62     
======================================================
+ Hits                     5072     5134      +62     
  Misses                   3118     3118              
Files with missing lines Coverage Δ
...pp/Packages/Features/Controller/AuthController.php 100.00% <100.00%> (ø)
src/app/Packages/Features/Tests/LogoutTest.php 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zigzagdev zigzagdev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@zigzagdev
zigzagdev merged commit bf1b3f3 into feat/user-logout Jul 15, 2026
28 checks passed
@zigzagdev
zigzagdev deleted the feat/user-logout_presentation-layer branch July 15, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implement Presentation layer for User Logout / ユーザーログアウトのPresentation層実装

1 participant