diff --git a/lib/error_tracker/web.ex b/lib/error_tracker/web.ex index bcf95bd..448909d 100644 --- a/lib/error_tracker/web.ex +++ b/lib/error_tracker/web.ex @@ -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 diff --git a/lib/error_tracker/web/router.ex b/lib/error_tracker/web/router.ex index 58a2b44..294342f 100644 --- a/lib/error_tracker/web/router.ex +++ b/lib/error_tracker/web/router.ex @@ -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