Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade omniauth-oauth2 #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
30 changes: 15 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ PATH
specs:
omniauth-kakao (0.2.0)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.3.1)
omniauth-oauth2 (~> 1.5.0)

GEM
remote: http://rubygems.org/
specs:
coderay (1.1.1)
diff-lcs (1.2.5)
fakeweb (1.3.0)
faraday (0.9.2)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.14)
formatador (0.2.5)
Expand All @@ -29,38 +29,38 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
hashie (3.4.4)
jwt (1.5.4)
hashie (3.5.7)
jwt (1.5.6)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
lumberjack (1.0.10)
method_source (0.8.2)
multi_json (1.12.1)
multi_xml (0.5.5)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nenv (0.3.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
oauth2 (1.2.0)
faraday (>= 0.8, < 0.10)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-oauth2 (1.3.1)
oauth2 (~> 1.0)
omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3)
omniauth-oauth2 (1.5.0)
oauth2 (~> 1.1)
omniauth (~> 1.2)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (2.0.1)
rack (2.0.5)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
Expand All @@ -87,4 +87,4 @@ DEPENDENCIES
rspec (~> 2.14, >= 2.14.1)

BUNDLED WITH
1.12.3
1.12.5
13 changes: 3 additions & 10 deletions lib/omniauth/strategies/kakao.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Kakao < OmniAuth::Strategies::OAuth2
{
'name' => raw_properties['nickname'],
'image' => raw_properties['thumbnail_image'],
'email' => raw_info['kaccount_email'],
}
end

Expand All @@ -31,16 +32,8 @@ def initialize(app, *args, &block)
options[:callback_path] = options[:redirect_path] || DEFAULT_REDIRECT_PATH
end

def callback_phase
previous_callback_path = options.delete(:callback_path)
@env["PATH_INFO"] = "/auth/kakao/callback"
options[:callback_path] = previous_callback_path
super
end

def mock_call!(*)
options.delete(:callback_path)
super
def callback_url
options[:callback_url] || (full_host + script_name + callback_path)
end

private
Expand Down
2 changes: 1 addition & 1 deletion omniauth-kakao.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency 'omniauth', '~> 1.0'
s.add_dependency 'omniauth-oauth2', '~> 1.3.1'
s.add_dependency 'omniauth-oauth2', '~> 1.5.0'

s.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1'
s.add_development_dependency 'guard-rspec', '~> 4.2', '>= 4.2.8'
Expand Down
13 changes: 0 additions & 13 deletions spec/omniauth/strategies/kakao_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,6 @@ def make_request(url, opts={})
})
end

describe "GET /auth/kakao" do
it "should redirect to callback url (/auth/kakao/callback)" do
request = make_request("/auth/kakao")
middleware = make_middleware(CLIENT_ID)
code, env = middleware.call(request)

code.should == 302

actual_path = URI(env["Location"]).path
actual_path.should == "/auth/kakao/callback"
end
end

describe "GET /oauth" do
it "should request registered mock" do
request = make_request("/oauth")
Expand Down