riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 21 forks source link

Getting errors when passing a socket to Phauxth.Token.verify #24

Closed rissicay closed 7 years ago

rissicay commented 7 years ago

I'm just guessing, but it seems Phauxth.Token.verify isn't compatible with receiving a socket instead of a connection. The error I am getting is:

Request: GET /socket/websocket?token=fake_token&vsn=2.0.0 (exit) an exception was raised: (ArgumentError) argument error :erlang.apply(%Phoenix.Socket{assigns: %{}, channel: nil, channel_pid: nil, endpoint: Test.Endpoint, handler: Test.UserSocket, id: nil, join_ref: nil, joined: false, private: %{}, pubsub_server: Reddlst.PubSub, ref: nil, serializer: Phoenix.Transports.V2.WebSocketSerializer, topic: nil, transport: Phoenix.Transports.WebSocket, transport_name: :websocket, transport_pid: #PID<0.6284.0>, vsn: "2.0.0"}, :config, []) (phauxth) lib/phauxth/token.ex:74: Phauxth.Token.get_key_base/1

What do you think about adding support for socket to Phauxth.Token. Phoenix.Token has done it https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/token.ex

rissicay commented 7 years ago

Pull request here: https://github.com/riverrun/phauxth/pull/25

riverrun commented 7 years ago

Thanks for reporting this issue.

I'll look at it later today.

rissicay commented 7 years ago

currently works on master.

riverrun commented 7 years ago

Great! I'll update the hex package now.