fix(api): auth failed with basic type check

This commit is contained in:
DDDHuang 2021-12-29 19:32:05 +08:00
parent d769401869
commit 34dfc327f3
1 changed files with 2 additions and 2 deletions

View File

@ -151,9 +151,9 @@ authorize(Req) ->
ok ->
ok;
{error, token_timeout} ->
return_unauthorized(<<"TOKEN_TIME_OUT">>, <<"POST '/login', get new token">>);
{401, <<"TOKEN_TIME_OUT">>, <<"POST '/login', get new token">>};
{error, not_found} ->
return_unauthorized(<<"BAD_TOKEN">>, <<"POST '/login'">>)
{401, <<"BAD_TOKEN">>, <<"POST '/login', get new token">>}
end;
_ ->
return_unauthorized(<<"AUTHORIZATION_HEADER_ERROR">>,