|
@@ -4,7 +4,7 @@
|
|
|
-include_lib("nitro/include/nitro.hrl").
|
|
|
-include_lib("n2o/include/wf.hrl").
|
|
|
-include_lib("kvs/include/user.hrl").
|
|
|
--compile(export_all).
|
|
|
+-compile([export_all, nowarn_export_all]).
|
|
|
-export(?API).
|
|
|
|
|
|
-define(OAUTH_URI, "https://login.microsoftonline.com/common/oauth2/v2.0").
|
|
@@ -26,7 +26,7 @@ authorize_url() ->
|
|
|
oauth:uri(?AUTHORIZE, Params).
|
|
|
|
|
|
api_event(_, Args, _)->
|
|
|
- JSArgs = string:tokens(Args,"\\\\"),
|
|
|
+ JSArgs = string:tokens(Args,"\\\\"), %"
|
|
|
J = string:join(JSArgs,""),
|
|
|
[_|K1] = J,
|
|
|
[_|K2] = lists:reverse(K1),
|
|
@@ -83,7 +83,7 @@ api_call(Name, Props) ->
|
|
|
Req = {?API_URI ++ Name, Authorization},
|
|
|
|
|
|
case httpc:request(get, Req, ?HTTP_OPTS, []) of
|
|
|
- {ok, {{"HTTP/1.1",200,"OK"},Hh,Bh}} ->
|
|
|
+ {ok, {{"HTTP/1.1",200,"OK"},_Hh,Bh}} ->
|
|
|
{Usr} = ?AVZ_JSON:decode(list_to_binary(Bh)), Usr;
|
|
|
{ok, {{"HTTP/1.1",_,_},_,B}} ->
|
|
|
{Err} = ?AVZ_JSON:decode(list_to_binary(B)), avz:event({error, wf:jse(Err)}), api_error;
|