Reconfigure session cookie (#3274)
* Reconfigure session cookie * Allow configure secure cookie (#3277) * Update config/runtime.exs Co-authored-by: ruslandoga <doga.ruslan@gmail.com> * fix runtime conf * Revert "fix runtime conf" This reverts commitpull/3282/headff37e479e4. * Revert "Update config/runtime.exs" This reverts commit5d9b310b02. * Revert "Allow configure secure cookie (#3277)" This reverts commit7401a2ad3f. * Read SECURE_COOKIE with defaults per cloud/selfhost * Include environment in cookie name * Remove redundant option * Format * s/Map.replace/Map.put * up * One more try * Prevent browser refreshes on socket connection error We'll keep the log and don't make the page look dumb even if there's some misconfiguration going on. --------- Co-authored-by: ruslandoga <doga.ruslan@gmail.com>
parent
d6d4d3dd75
commit
63fabcbb5f
@ -0,0 +1,15 @@
|
||||
defmodule PlausibleWeb.LiveSocket do
|
||||
use Phoenix.LiveView.Socket
|
||||
require Logger
|
||||
|
||||
def connect(params, %Phoenix.Socket{} = socket, connect_info) do
|
||||
case Phoenix.LiveView.Socket.connect(params, socket, connect_info) do
|
||||
{:ok, %Phoenix.Socket{private: %{connect_info: %{session: nil}}}} ->
|
||||
Logger.error("Could not connect the live socket: no session found")
|
||||
{:error, :socket_auth_error}
|
||||
|
||||
other ->
|
||||
other
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue