Skip to content

Commit

Permalink
deny mqtt auth requests rather than ignoring
Browse files Browse the repository at this point in the history
  • Loading branch information
oscgonfer committed May 14, 2024
1 parent f62085c commit 61a914d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/v0/forwarding_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def authorize
username = params[:username]
token = topic && get_forwarding_token(topic)
authorized = token && username && User.forwarding_subscription_authorized?(token, username)
render json: { result: authorized ? "allow" : "ignore" }
render json: { result: authorized ? "allow" : "deny" }
end

private
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/v0/forwarding_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
it "does not authorize the subscription" do
r = api_get "/forward", params
expect(response.status).to eq(200)
expect(r["result"]).to eq("ignore")
expect(r["result"]).to eq("deny")
end
end

Expand Down

0 comments on commit 61a914d

Please sign in to comment.