Skip to content

Commit

Permalink
Improve docs regarding LiveView scope (#115)
Browse files Browse the repository at this point in the history
Closes #114
  • Loading branch information
odarriba authored Dec 9, 2024
1 parent b30254e commit 9b09bb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/error_tracker/web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ defmodule ErrorTracker.Web do
...
error_tracker_dashboard "/errors"
scope "/" do
...
error_tracker_dashboard "/errors"
end
end
```
This will add the routes needed for ErrorTracker's dashboard to work.
**Note:** when adding the dashboard routes, make sure you do it in an scope that
has CSRF protection (usually the `:browser` pipeline in most projects), as
otherwise you may experience LiveView issues like crashes and redirections.
## Security considerations
Errors may contain sensitive information, like IP addresses, users information
Expand Down
3 changes: 3 additions & 0 deletions lib/error_tracker/web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ defmodule ErrorTracker.Web.Router do
It requires a path in which you are going to serve the web interface.
In order to work properly, the route should be in a scope with CSRF protection
(usually the `:browser` pipeline).
## Security considerations
The dashboard inlines both the JS and CSS assets. This means that, if your
Expand Down

0 comments on commit 9b09bb8

Please sign in to comment.