Skip to content

Commit 9b09bb8

Browse files
authored
Improve docs regarding LiveView scope (#115)
Closes #114
1 parent b30254e commit 9b09bb8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/error_tracker/web.ex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@ defmodule ErrorTracker.Web do
1313
1414
...
1515
16-
error_tracker_dashboard "/errors"
16+
scope "/" do
17+
...
18+
19+
error_tracker_dashboard "/errors"
20+
end
1721
end
1822
```
1923
2024
This will add the routes needed for ErrorTracker's dashboard to work.
2125
26+
**Note:** when adding the dashboard routes, make sure you do it in an scope that
27+
has CSRF protection (usually the `:browser` pipeline in most projects), as
28+
otherwise you may experience LiveView issues like crashes and redirections.
29+
2230
## Security considerations
2331
2432
Errors may contain sensitive information, like IP addresses, users information

lib/error_tracker/web/router.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ defmodule ErrorTracker.Web.Router do
1010
1111
It requires a path in which you are going to serve the web interface.
1212
13+
In order to work properly, the route should be in a scope with CSRF protection
14+
(usually the `:browser` pipeline).
15+
1316
## Security considerations
1417
1518
The dashboard inlines both the JS and CSS assets. This means that, if your

0 commit comments

Comments
 (0)