LiveView Websocket Security

Using the route helpers is better because:

  1. you validate the route actually exists in your app.
  2. if you change the url, you don’t have to change the code

That said, this will just work too: <%= link "Logout", to: Routes.user_session_path(@socket, :delete), method: :delete %>.