Skip to content

Commit

Permalink
Ignore query string for callback url since BigCommerce does not ignor…
Browse files Browse the repository at this point in the history
…e it for redirect_uri

Adding coverage folder to .gitignore
  • Loading branch information
carsonreinke committed May 5, 2016
1 parent a72dae4 commit 082962a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.bundle
Gemfile.lock
coverage
reports
reports
5 changes: 5 additions & 0 deletions lib/omniauth/strategies/bigcommerce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def authorize_params
end
end
end

#Exclude query string in callback
def callback_url
full_host + script_name + callback_path
end
end
end
end
Expand Down
11 changes: 11 additions & 0 deletions spec/omniauth/strategies/bigcommerce_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
it 'should have the correct path' do
expect(subject.callback_path).to eq('/auth/bigcommerce/callback')
end

it 'should use no query string for callback url' do
request = double('Request', :params => {}, :cookies => {}, :env => {})
allow(request).to receive(:scheme).and_return('http')
allow(request).to receive(:url).and_return('http://example.com')

allow(subject).to receive(:request).and_return(request)
allow(subject).to receive(:script_name).and_return('')

subject.callback_url
end
end

context 'authorize options' do
Expand Down

0 comments on commit 082962a

Please sign in to comment.