From 111ff13b18feb3c37319c4ab733372d4299d2c72 Mon Sep 17 00:00:00 2001 From: dieter vanhove Date: Fri, 12 Aug 2022 14:34:02 +0200 Subject: [PATCH 1/2] unleash guard docs --- README.md | 12 ++++++++++++ config/config.php | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 973f05a..1e67e60 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,18 @@ The available options are default limited to `'styles', 'bold', 'italic', 'link' For all available options check: https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html +## Protecting your routes + +We are using https://github.com/esign/laravel-unleash-guard to protect our routes. After installation you can simply add the UnleashWebsiteMiddleware to your routes in your config file +``` +use Esign\UnleashGuard\Http\Middleware\UnleashWebsiteMiddleware; + +return [ + ... + 'web-middleware' => ['web', UnleashWebsiteMiddleware::class], + 'api-middleware' => [\App\Http\Middleware\EncryptCookies::class, UnleashWebsiteMiddleware::class], +]; +``` ### Testing diff --git a/config/config.php b/config/config.php index 09df0eb..97bb74e 100644 --- a/config/config.php +++ b/config/config.php @@ -2,7 +2,7 @@ return [ 'database' => env('INLINE_EDIT_DB_TABLE', 'dictionary'), - 'web-middleware' => ['web'], - 'api-middleware' => ['api'], 'is_multilang' => env('INLINE_EDIT_MULTILANG', true), + 'web-middleware' => ['web'], + 'api-middleware' => [\App\Http\Middleware\EncryptCookies::class], ]; \ No newline at end of file From d4c5d52a1d7abc71382be129ae11a8a77802a7cf Mon Sep 17 00:00:00 2001 From: dieter vanhove Date: Fri, 12 Aug 2022 14:54:27 +0200 Subject: [PATCH 2/2] add throttle back --- README.md | 4 ++-- config/config.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e67e60..281555a 100644 --- a/README.md +++ b/README.md @@ -91,14 +91,14 @@ For all available options check: https://ckeditor.com/docs/ckeditor5/latest/api/ ## Protecting your routes -We are using https://github.com/esign/laravel-unleash-guard to protect our routes. After installation you can simply add the UnleashWebsiteMiddleware to your routes in your config file +We are using https://github.com/esign/laravel-unleash-guard to protect our routes. After installation you can simply add the UnleashWebsiteMiddleware & EncryptCookies to your routes in your config file as shown below. ``` use Esign\UnleashGuard\Http\Middleware\UnleashWebsiteMiddleware; return [ ... 'web-middleware' => ['web', UnleashWebsiteMiddleware::class], - 'api-middleware' => [\App\Http\Middleware\EncryptCookies::class, UnleashWebsiteMiddleware::class], + 'api-middleware' => ['api', \App\Http\Middleware\EncryptCookies::class, UnleashWebsiteMiddleware::class], ]; ``` diff --git a/config/config.php b/config/config.php index 97bb74e..b1c5fd0 100644 --- a/config/config.php +++ b/config/config.php @@ -4,5 +4,5 @@ 'database' => env('INLINE_EDIT_DB_TABLE', 'dictionary'), 'is_multilang' => env('INLINE_EDIT_MULTILANG', true), 'web-middleware' => ['web'], - 'api-middleware' => [\App\Http\Middleware\EncryptCookies::class], + 'api-middleware' => ['api'], ]; \ No newline at end of file