From 20f8173f3126b4ffa5c8af7d708cc90985e57763 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 22 Apr 2023 11:32:25 +0900 Subject: [PATCH 1/2] docs: remove command prompt $ --- docs/addons/jwt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/addons/jwt.md b/docs/addons/jwt.md index 44bf4a198..fd8ca5210 100644 --- a/docs/addons/jwt.md +++ b/docs/addons/jwt.md @@ -232,7 +232,7 @@ class LoginController extends BaseController You could send a request with the existing user's credentials by curl like this: ```console -$ curl --location 'http://localhost:8080/auth/jwt' \ +curl --location 'http://localhost:8080/auth/jwt' \ --header 'Content-Type: application/json' \ --data-raw '{"email" : "admin@example.jp" , "password" : "passw0rd!"}' ``` From 370d6aece7afee87f29fce61ababbd52074ee616 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 22 Apr 2023 11:31:21 +0900 Subject: [PATCH 2/2] docs: fix sample code to protect routes Because the route `/api` was not protected. --- docs/addons/jwt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/addons/jwt.md b/docs/addons/jwt.md index fd8ca5210..efcc54c8c 100644 --- a/docs/addons/jwt.md +++ b/docs/addons/jwt.md @@ -257,7 +257,7 @@ would use the `$filters` setting on **app/Config/Filters.php**. ```php public $filters = [ - 'jwt' => ['before' => ['api/*']], + 'jwt' => ['before' => ['api', 'api/*']], ]; ```