mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-16 04:46:46 +08:00
ccc64876a8
* Add support for widget binary payloads * Migrate LV auth to a separate hook * Properly set user buffer when encoding
19 lines
398 B
Elixir
19 lines
398 B
Elixir
defmodule LivebookWeb.Socket do
|
|
use Phoenix.Socket
|
|
|
|
channel "js_output", LivebookWeb.JSOutputChannel
|
|
|
|
@impl true
|
|
def connect(_params, socket, info) do
|
|
auth_mode = Livebook.Config.auth_mode()
|
|
|
|
if LivebookWeb.AuthPlug.authenticated?(info.session || %{}, info.uri.port, auth_mode) do
|
|
{:ok, socket}
|
|
else
|
|
:error
|
|
end
|
|
end
|
|
|
|
@impl true
|
|
def id(_socket), do: nil
|
|
end
|