This commit is contained in:
turtled 2016-10-31 14:42:22 +08:00
parent 611ca0dca4
commit b82e67b081
1 changed files with 2 additions and 1 deletions

View File

@ -133,7 +133,8 @@ authorized(Req) ->
false;
"Basic " ++ BasicAuth ->
{Username, Password} = user_passwd(BasicAuth),
case emqttd_access_control:auth(#mqtt_client{username = Username}, Password) of
{ok, Peer} = Req:get(peername),
case emqttd_access_control:auth(#mqtt_client{username = Username, peername = Peer}, Password) of
ok ->
true;
{error, Reason} ->