Fallback to original implementation of plain auth_mechanism if socket is not provided

This commit is contained in:
Aaron Seo 2025-04-24 13:41:57 -07:00
parent 614ce25cc7
commit 3bcdc0f359
No known key found for this signature in database
GPG Key ID: 7F5C877C31189F37
1 changed files with 9 additions and 0 deletions

View File

@ -40,8 +40,17 @@ handle_response(Response, #state{socket = Socket}) ->
rabbit_access_control:check_user_login(User, AuthProps);
error ->
{protocol_error, "response ~tp invalid", [Response]}
end;
handle_response(Response, _State) ->
case extract_user_pass(Response) of
{ok, User, Pass} ->
rabbit_access_control:check_user_pass_login(User, Pass);
error ->
{protocol_error, "response ~tp invalid", [Response]}
end.
build_auth_props(Pass, Socket) ->
[{password, Pass}, {sockOrAddr, Socket}].