Skip to content

Commit

Permalink
Adjust provisioning to allow for use with RabbitMQ
Browse files Browse the repository at this point in the history
Slight changes to the provisioning to allow login to RabbitMQ MQTT broker.
With RabbitMQ the username and password must be submitted as part of the URL:
`mqtt://user:password@broker.domain`.

Signed-off-by: Winford <winford@object.stream>
  • Loading branch information
UncleGrumpy committed May 10, 2024
1 parent affdd9c commit f5405f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions priv/provision.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ <h2>Device</h2>
type="text"
name="gateway_user"
placeholder="Enter MQTT username"
required
/>
</div>

Expand All @@ -380,7 +379,6 @@ <h2>Device</h2>
type="password"
name="gateway_pass"
placeholder="Enter MQTT password"
required
/>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/c3card_provision.erl
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ handle_req("POST", [], Conn) ->
Pass = proplists:get_value("pass", Params),
EnableMQTT = proplists:get_value("gateway_enabled", Params, "off"),
Gateway = proplists:get_value("gateway", Params),
User = proplists:get_value("gateway_user", Params),
Password = proplists:get_value("gateway_pass", Params),
User = proplists:get_value("gateway_user", Params, ""),
Password = proplists:get_value("gateway_pass", Params, ""),
DeviceName = proplists:get_value("device_name", Params),

ok = save_config(
Expand Down

0 comments on commit f5405f8

Please sign in to comment.