From 3bcdc0f3596ba4a037f9fa6da77a3247b3218f84 Mon Sep 17 00:00:00 2001 From: Aaron Seo Date: Thu, 24 Apr 2025 13:41:57 -0700 Subject: [PATCH] Fallback to original implementation of plain auth_mechanism if socket is not provided --- deps/rabbit/src/rabbit_auth_mechanism_plain.erl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deps/rabbit/src/rabbit_auth_mechanism_plain.erl b/deps/rabbit/src/rabbit_auth_mechanism_plain.erl index 22f22dc327..35d3ecb873 100644 --- a/deps/rabbit/src/rabbit_auth_mechanism_plain.erl +++ b/deps/rabbit/src/rabbit_auth_mechanism_plain.erl @@ -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}].