Skip to content

A self-hosted media server and file management system

chore: spelling consistency

aminnausin92bc66d341f0
diff --git a/app/Http/Controllers/Api/V1/CategoryController.php b/app/Http/Controllers/Api/V1/CategoryController.php
index c4116cf5..40fa8eb6 100755
--- a/app/Http/Controllers/Api/V1/CategoryController.php
+++ b/app/Http/Controllers/Api/V1/CategoryController.php
@@ -61,7 +61,7 @@ class CategoryController extends Controller {
*/
public function update(CategoryUpdateRequest $request, Category $category) {
if (! Auth::user() || Auth::user()->id !== 1) {
- $this->unauthorized();
+ $this->unauthorised();
}
try {
@@ -88,7 +88,7 @@ class CategoryController extends Controller {
*/
public function updatePrivacy(CategoryPrivacyUpdateRequest $request, Category $category) {
if (Auth::id() !== 1) {
- $this->unauthorized();
+ $this->unauthorised();
}
try {
diff --git a/app/Http/Controllers/Api/V1/RecordController.php b/app/Http/Controllers/Api/V1/RecordController.php
index ee7c9a21..4ff492c9 100644
--- a/app/Http/Controllers/Api/V1/RecordController.php
+++ b/app/Http/Controllers/Api/V1/RecordController.php
@@ -34,7 +34,7 @@ class RecordController extends Controller {
public function userViewCount(Metadata $metadata) {
if (! Auth::user()) {
- $this->unauthorized();
+ $this->unauthorised();
}
try {
diff --git a/app/Http/Controllers/Api/V1/SubTaskController.php b/app/Http/Controllers/Api/V1/SubTaskController.php
index a5228685..1bb3c7ea 100644
--- a/app/Http/Controllers/Api/V1/SubTaskController.php
+++ b/app/Http/Controllers/Api/V1/SubTaskController.php
@@ -39,7 +39,7 @@ class SubTaskController extends Controller {
*/
public function show(Request $request, Task $task) {
if (! Auth::user() || Auth::user()->id !== 1) {
- $this->unauthorized();
+ $this->unauthorised();
}
try {
diff --git a/app/Http/Controllers/Api/V1/UserController.php b/app/Http/Controllers/Api/V1/UserController.php
index af28468b..232be594 100644
--- a/app/Http/Controllers/Api/V1/UserController.php
+++ b/app/Http/Controllers/Api/V1/UserController.php
@@ -18,7 +18,7 @@ class UserController extends Controller {
*/
public function index() {
if (! Auth::user()) {
- $this->unauthorized();
+ $this->unauthorised();
}
if (Auth::user()->id !== 1) {
@@ -45,7 +45,7 @@ class UserController extends Controller {
*/
public function destroy(User $user) {
if (! Auth::user() || Auth::user()->id !== 1 || Auth::user()->id === $user->id) {
- $this->unauthorized();
+ $this->unauthorised();
}
return $user->delete() ? $this->success('', 'Success', 200) : $this->error('', 'Not found', 404);
@@ -53,7 +53,7 @@ class UserController extends Controller {
public function sessionCount() {
if (! Auth::user()) {
- $this->unauthorized();
+ $this->unauthorised();
}
// Try returning plausible data if api response is successful
diff --git a/app/Traits/HttpResponses.php b/app/Traits/HttpResponses.php
index 80ace99e..34453e00 100755
--- a/app/Traits/HttpResponses.php
+++ b/app/Traits/HttpResponses.php
@@ -17,8 +17,8 @@ trait HttpResponses {
], $code);
}
- protected function unauthorized() {
- abort(401, 'Unauthorized action.');
+ protected function unauthorised() {
+ abort(401, 'Unauthorised action.');
}
protected function forbidden() {
diff --git a/tests/Feature/Settings/SessionControllerTest.php b/tests/Feature/Settings/SessionControllerTest.php
index 934a1a59..79b10a65 100644
--- a/tests/Feature/Settings/SessionControllerTest.php
+++ b/tests/Feature/Settings/SessionControllerTest.php
@@ -49,7 +49,7 @@ class SessionControllerTest extends TestCase {
public function test_unauthenticated_users_cannot_access_sessions() {
$response = $this->getJson('/api/settings/sessions');
- $response->assertUnauthorized(); // 401
+ $response->assertUnauthorised(); // 401
}
private function getBaseSession(): array {