Skip to content

Commit

Permalink
Merge pull request #24 from mjarmula/support_omniauth_2
Browse files Browse the repository at this point in the history
Add support for omniauth 2.0
  • Loading branch information
synth authored Oct 2, 2021
2 parents a00ee12 + 4102354 commit ffb5618
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions omniauth-microsoft_graph.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_runtime_dependency 'omniauth', '~> 1.1', '>= 1.1.1'
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.6'
spec.add_runtime_dependency 'omniauth', '~> 2.0.4'
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.7.1'
spec.add_development_dependency "sinatra", '~> 0'
spec.add_development_dependency "rake", '~> 12.3.3', '>= 12.3.3'
spec.add_development_dependency 'rspec', '~> 3.6'
Expand Down
6 changes: 6 additions & 0 deletions spec/omniauth/strategies/microsoft_graph_oauth2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,19 @@

describe '#callback_path' do
it 'has the correct default callback path' do
allow(subject).to receive(:script_name).and_return('')
expect(subject.callback_path).to eq('/auth/microsoft_graph/callback')
end

it 'should set the callback_path parameter if present' do
@options = { callback_path: '/auth/foo/callback' }
expect(subject.callback_path).to eq('/auth/foo/callback')
end

it 'should set the callback_path with script_name if present' do
allow(subject).to receive(:script_name).and_return('/api/v1')
expect(subject.callback_path).to eq('/api/v1/auth/microsoft_graph/callback')
end
end

describe '#info' do
Expand Down

0 comments on commit ffb5618

Please sign in to comment.