Skip to content

Commit 37d8c71

Browse files
committed
docs: fix sample controller code
1 parent 63a6fdf commit 37d8c71

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/addons/jwt.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ class LoginController extends BaseController
135135

136136
// Validate credentials
137137
if (! $this->validateData($this->request->getPost(), $rules)) {
138-
return $this->failValidationErrors($this->validator->getErrors(), 422);
138+
return $this->fail(
139+
['errors' => $this->validator->getErrors()],
140+
$this->codes['unauthorized']
141+
);
139142
}
140143

141144
// Get the credentials for login

0 commit comments

Comments
 (0)