Skip to content
Snippets Groups Projects
Commit 51669ff9 authored by Dmitry Ivanov's avatar Dmitry Ivanov
Browse files

fix: Take `auth_type` into account in `console.connect`

NO_DOC=picodata internal patch
NO_CHANGELOG=picodata internal patch
NO_TEST=picodata internal patch
parent 08ca239e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment