user.auth ArgumentError
Closed this issue · 2 comments
ConnorRigby commented
Generated demo_fw app
NervesHub server: nerveshub.fly.dev:443
Username or email address: connorrigby
NervesHub password:
Authenticating...
** (ArgumentError) errors were found at the given arguments:
* 1st argument: not a binary
:erlang.binary_to_atom(nil, :utf8)
(tesla 1.8.0) lib/tesla/adapter/mint.ex:161: Tesla.Adapter.Mint.open_conn/2
(tesla 1.8.0) lib/tesla/adapter/mint.ex:121: Tesla.Adapter.Mint.do_request/5
(tesla 1.8.0) lib/tesla/adapter/mint.ex:61: Tesla.Adapter.Mint.call/2
(tesla 1.8.0) lib/tesla/middleware/json.ex:57: Tesla.Middleware.JSON.call/3
(tesla 1.8.0) lib/tesla/middleware/follow_redirects.ex:46: Tesla.Middleware.FollowRedirects.redirect/3
(nerves_hub_cli 2.0.0) lib/nerves_hub_cli/api.ex:42: NervesHubCLI.API.request/4
(nerves_hub_cli 2.0.0) lib/mix/tasks/nerves_hub.user.ex:108: Mix.Tasks.NervesHub.User.auth/1
This happens when using the official docs here
ConnorRigby commented
upon digging further, this seems to be an issue w/ the URI encoding
MINT_OPTS: {%URI{
scheme: nil,
authority: "nerveshub.fly.dev:443",
userinfo: nil,
host: "nerveshub.fly.dev",
port: 443,
path: "/api/users/login",
query: nil,
fragment: nil
},
IO.inspect({uri, opts}, label: "MINT_OPTS")
with {:ok, conn} <-
HTTP.connect(String.to_atom(uri.scheme), uri.host, uri.port, Enum.into(opts, [])) do
# If there were redirects, and passed `closed_conn: false`, we need to close opened connections to these intermediate hosts.
{:ok, conn, Map.put(opts, :close_conn, true)}
end
ConnorRigby commented
adding scheme: "https",
to the :nerves_hub_cli
config.exs entry solved this.