Skip to content

Commit

Permalink
Merge pull request #1 from mfa777/#32_allow-for-omniauth-2.0
Browse files Browse the repository at this point in the history
kazasiki#32 allow for omniauth 2.0
  • Loading branch information
mfa777 authored Jun 21, 2022
2 parents eb6bc4f + 0cceffa commit f714740
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/omniauth-line/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module OmniAuth
module Line
VERSION = "0.1.0"
VERSION = "1.0.0"
end
end
2 changes: 1 addition & 1 deletion lib/omniauth/strategies/line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def callback_phase

def callback_url
# Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7
options[:callback_url] || (full_host + script_name + callback_path)
options[:callback_url] || (full_host + callback_path)
end

uid { raw_info['userId'] }
Expand Down
3 changes: 2 additions & 1 deletion omniauth-line.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency 'json', '>= 2.3.0'
s.add_dependency 'omniauth-oauth2', '~>1.3'
s.add_dependency 'omniauth', '~> 2.0'
s.add_dependency 'omniauth-oauth2', '~> 1.7.1'
s.add_development_dependency 'bundler', '~> 2.0'
end
9 changes: 9 additions & 0 deletions spec/omniauth/strategies/line_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
end
end

describe '#callback_url' do
it 'should returns callback url' do
base_url = 'https://example.com'
allow(subject).to receive(:full_host) { base_url }
allow(subject).to receive(:script_name) { '/v1' }
expect(subject.send(:callback_url)).to eq "#{base_url}/v1/auth/line/callback"
end
end

end

private
Expand Down

0 comments on commit f714740

Please sign in to comment.