mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Returns unauthorized error when we do not have correct credentials
This commit is contained in:
parent
ead83b008c
commit
36ac1cd6c7
@ -183,7 +183,9 @@ check_permissions2(#request{ip={IP, _Port}}, Call, _Policy) ->
|
|||||||
end;
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
unauthorized_response()
|
unauthorized_response()
|
||||||
end.
|
end;
|
||||||
|
check_permissions2(_Request, _Call, _Policy) ->
|
||||||
|
unauthorized_response().
|
||||||
|
|
||||||
oauth_check_token(Scope, Token) when is_atom(Scope) ->
|
oauth_check_token(Scope, Token) when is_atom(Scope) ->
|
||||||
oauth_check_token(atom_to_binary(Scope, utf8), Token);
|
oauth_check_token(atom_to_binary(Scope, utf8), Token);
|
||||||
|
@ -43,7 +43,6 @@ defmodule ModHttpApiTest do
|
|||||||
{200, _, _} = :mod_http_api.process(["open_cmd"], request)
|
{200, _, _} = :mod_http_api.process(["open_cmd"], request)
|
||||||
end
|
end
|
||||||
|
|
||||||
@tag pending: true
|
|
||||||
test "Call to user, admin, restricted commands without authentication are rejected" do
|
test "Call to user, admin, restricted commands without authentication are rejected" do
|
||||||
request = request(method: :POST, data: "[]")
|
request = request(method: :POST, data: "[]")
|
||||||
{401, _, _} = :mod_http_api.process(["user_cmd"], request)
|
{401, _, _} = :mod_http_api.process(["user_cmd"], request)
|
||||||
|
Loading…
Reference in New Issue
Block a user