Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Commit bfeb79e

Browse files
author
José Postiga
committed
refactor(Accounts): replace 202 response status for 204 when logging user out
1 parent 9059cf3 commit bfeb79e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ All notable changes to `laravel-portugal/api` will be documented in this file
1616

1717
### Changed
1818

19-
- N/A
19+
- Switched from response status 202 to 204 on successful accounts' logout operation
2020

2121
### Deprecated
2222

domains/Accounts/Controllers/AccountsLogoutController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ public function __invoke(): Response
1919
{
2020
$this->auth->logout();
2121

22-
return new Response('', Response::HTTP_ACCEPTED);
22+
return new Response('', Response::HTTP_NO_CONTENT);
2323
}
2424
}

domains/Accounts/Tests/Feature/AccountsLogoutTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function authenticated_user_can_make_logout(): void
3535
self::assertTrue(auth()->check());
3636

3737
$this->post(route('accounts.logout'), [], ['Authorization' => "Bearer {$token}"])
38-
->assertResponseStatus(Response::HTTP_ACCEPTED);
38+
->assertResponseStatus(Response::HTTP_NO_CONTENT);
3939

4040
self::assertTrue(auth()->guest());
4141
}

0 commit comments

Comments
 (0)