Skip to content

Commit ffb5618

Browse files
authored
Merge pull request #24 from mjarmula/support_omniauth_2
Add support for omniauth 2.0
2 parents a00ee12 + 4102354 commit ffb5618

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

omniauth-microsoft_graph.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
1818
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
1919
spec.require_paths = ["lib"]
2020

21-
spec.add_runtime_dependency 'omniauth', '~> 1.1', '>= 1.1.1'
22-
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.6'
21+
spec.add_runtime_dependency 'omniauth', '~> 2.0.4'
22+
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.7.1'
2323
spec.add_development_dependency "sinatra", '~> 0'
2424
spec.add_development_dependency "rake", '~> 12.3.3', '>= 12.3.3'
2525
spec.add_development_dependency 'rspec', '~> 3.6'

spec/omniauth/strategies/microsoft_graph_oauth2_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,19 @@
243243

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

249250
it 'should set the callback_path parameter if present' do
250251
@options = { callback_path: '/auth/foo/callback' }
251252
expect(subject.callback_path).to eq('/auth/foo/callback')
252253
end
254+
255+
it 'should set the callback_path with script_name if present' do
256+
allow(subject).to receive(:script_name).and_return('/api/v1')
257+
expect(subject.callback_path).to eq('/api/v1/auth/microsoft_graph/callback')
258+
end
253259
end
254260

255261
describe '#info' do

0 commit comments

Comments
 (0)