Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/service_provider_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def authorize
end

def authorization_token_valid?
return false if authorization_token.blank?
ActiveSupport::SecurityUtils.secure_compare(
authorization_token,
IdentityConfig.store.dashboard_api_token,
Expand Down
10 changes: 10 additions & 0 deletions spec/controllers/service_provider_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@
end
end

context 'missing token in header' do
let(:token) { nil }

it 'returns a 401' do
post :update

expect(response.status).to eq 401
end
end

context 'feature off' do
let(:use_feature) { false }
before { post :update }
Expand Down