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 authored and timcowlishaw committed May 15, 2024
1 parent b421ff1 commit 77a4212
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 77a4212

Please sign in to comment.