samedi 9 février 2019

PhoenixChannelTest connect/2 function returns error

I am usisng phoneix version 1.3.4.

I have a UserSocket which validates jwt and connects user to the socket.

So in order to test validating jwt to connect socket, I followed phoenix guide and made a connect function in a setup block like below:

{:ok, _, jwt} = Authentication.encode_and_sign(user)
{:ok, socket} = connect(UserSocket, %{token: jwt})

But it doesnt connect to socket and trigger an error {:error, %FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :peek_protected, kind: nil, module: :jose_jws}}

What am i missing here? any suggestions?

Aucun commentaire:

Enregistrer un commentaire