Skip to content

Commit 465b58e

Browse files
authored
update PreventRegularBrowserAccess middleware docs (#127)
1 parent f5d9e0b commit 465b58e

File tree

1 file changed

+2
-17
lines changed
  • resources/views/docs/desktop/1/digging-deeper

1 file changed

+2
-17
lines changed

resources/views/docs/desktop/1/digging-deeper/security.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Security
33
order: 400
44
---
5+
56
# Security
67

78
When building desktop applications it's essential to take your application's security to the next level, both to
@@ -72,27 +73,11 @@ but you should do all you can to prevent unwanted attack vectors from being made
7273

7374
#### Prevent regular browser access
7475

75-
When you're ready, you should add the `PreventRegularBrowserAccess` middleware to your application's global middleware
76-
stack, **especially before building your application for production release**.
77-
78-
**This is NOT done for you.**
76+
When you are running a build, the global `PreventRegularBrowserAccess` middleware will be applied to all your routes automatically.
7977

8078
This ensures that only requests coming from the web view shell that booted your application can make requests into your
8179
application.
8280

83-
Append the middleware in your `bootstrap/app.php` file:
84-
85-
```php
86-
use Native\Laravel\Http\Middleware\PreventRegularBrowserAccess;
87-
88-
return Application::configure(basePath: dirname(__DIR__))
89-
// ...
90-
->withMiddleware(function (Middleware $middleware) {
91-
$middleware->append(PreventRegularBrowserAccess::class);
92-
})
93-
// ...
94-
```
95-
9681
## Protecting your users and their data
9782

9883
Equally important is how your app protects users. NativePHP is a complex combination of powerful software and so there

0 commit comments

Comments
 (0)