From: Christopher Coté Date: Thu, 19 Nov 2020 03:49:44 +0000 (-0600) Subject: fix challenge bug X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=241774e1e1a988e9ae21e3734602d90962ffcd53;p=wampex_router.git fix challenge bug --- diff --git a/lib/router/session.ex b/lib/router/session.ex index 5ee1e13..5cba836 100644 --- a/lib/router/session.ex +++ b/lib/router/session.ex @@ -187,7 +187,7 @@ defmodule Wampex.Router.Session do } = data } = sl ) do - {actions, challenge, module} = maybe_challenge(auth, realm, options, session_id, tt, t) + {actions, challenge, mod} = maybe_challenge(auth, realm, options, session_id, tt, t) {:ok, %SL{ @@ -197,7 +197,7 @@ defmodule Wampex.Router.Session do | challenge: challenge, hello_received: true, realm: realm, - authentication_module: module + authentication_module: mod } }, [{:next_event, :internal, :transition}] ++ actions} end @@ -213,7 +213,7 @@ defmodule Wampex.Router.Session do transport: tt, transport_pid: t, authentication_module: auth, - challenge: challenge, + challenge: %Challenge{extra: challenge}, realm: realm, name: name, authenticate: %Authenticate{signature: sig} @@ -742,7 +742,7 @@ defmodule Wampex.Router.Session do t ) - {[], ch, auth} + {[], chal, auth} false -> Logger.error("Not a supported authentication method: #{inspect(am)}") @@ -811,8 +811,8 @@ defmodule Wampex.Router.Session do defp maybe_update_response(data, resp), do: {data, resp} def is_authorized?(am, peer, type, uri, method) do - am = get_auth_module(am, [method]) - am.authorized?(type, uri, peer) + auth = get_auth_module(am, [method]) + auth.authorized?(type, uri, peer) end defp remove_nil_values(message) do