Skip to content

Commit

Permalink
temporarily comment out authorized?/1 function as its just returning …
Browse files Browse the repository at this point in the history
…"true". See: #54 for auth
  • Loading branch information
nelsonic committed Oct 15, 2021
1 parent 548cbf2 commit f12eaeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion coveralls.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"lib/chat/application.ex",
"lib/chat_web/router.ex",
"lib/chat_web/views/error_helpers.ex",
"lib/chat_web/telemetry.ex"
"lib/chat_web/telemetry.ex",
"lib/chat_web/channels/user_socket.ex"
]
}
17 changes: 9 additions & 8 deletions lib/chat_web/channels/room_channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ defmodule ChatWeb.RoomChannel do
use ChatWeb, :channel

@impl true
def join("room:lobby", payload, socket) do
if authorized?(payload) do
def join("room:lobby", _payload, socket) do
# if authorized?(payload) do
send(self(), :after_join)
{:ok, socket}
else
{:error, %{reason: "unauthorized"}}
end
# else
# {:error, %{reason: "unauthorized"}}
# end
end

def handle_in("ping", payload, socket) do
Expand All @@ -25,9 +25,10 @@ defmodule ChatWeb.RoomChannel do
end

# Add authorization logic here as required.
defp authorized?(_payload) do
true
end
# Auth coming soon via: https://github.com/dwyl/phoenix-chat-example/issues/54
# defp authorized?(_payload) do
# true
# end

@impl true
def handle_info(:after_join, socket) do
Expand Down

0 comments on commit f12eaeb

Please sign in to comment.