From 51669ff95ee84288be26e3c467a96c7eaa42745e Mon Sep 17 00:00:00 2001
From: Dmitry Ivanov <ivadmi5@gmail.com>
Date: Mon, 31 Jul 2023 13:53:49 +0300
Subject: [PATCH] fix: Take `auth_type` into account in `console.connect`

NO_DOC=picodata internal patch
NO_CHANGELOG=picodata internal patch
NO_TEST=picodata internal patch
---
 src/box/lua/console.lua | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
index b97e9733f2..c0b0197e3b 100644
--- a/src/box/lua/console.lua
+++ b/src/box/lua/console.lua
@@ -850,10 +850,18 @@ local function connect(uri, opts)
         error('Usage: console.connect("[login:password@][host:]port")')
     end
 
+    if opts.auth_type == nil and u.params ~= nil and
+       u.params.auth_type ~= nil then
+        opts.auth_type = u.params.auth_type[1]
+    end
+
     -- We don't know if the remote end is binary or Lua console so we first try
     -- to connect to it as binary using net.box and fall back on Lua console if
     -- it fails.
-    local remote = net_box.connect(uri, {connect_timeout = opts.timeout})
+    local remote = net_box.connect(uri, {
+        connect_timeout = opts.timeout,
+        auth_type = opts.auth_type,
+    })
     if remote.state == 'error' then
         local err = remote.error
         remote = nil
-- 
GitLab