devise-multi_auth 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/Rakefile +8 -2
- data/lib/devise/multi_auth/version.rb +1 -1
- data/lib/devise_multi_auth.rb +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ff584c3f4b354f13dbb722df1b68fa277fb7290
|
4
|
+
data.tar.gz: ecd4357db53bb60f0599178c0c23022b149bee17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d6bd2163bb04a0595185a5de78ebd1105774a1fd03ccf8df7b55bf4d491ddcc7d0e277c9dc2dc4ad4b69aa90a898ebe8cecd7eee0a511de694ce9b98c6d76ac
|
7
|
+
data.tar.gz: 01a27cfc31cc9fd8ab45658b87b4e4ce8d4b57d8fb59777497142f4bd169ca17f260241bccacb9cf787cde7a890ed351d2b84625a5c596ab8c26b4951ae8edcd
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Devise::MultiAuth [![Version](https://badge.fury.io/rb/devise-multi_auth.png)](http://badge.fury.io/rb/devise-multi_auth)
|
1
|
+
# Devise::MultiAuth [![Build Status](https://travis-ci.org/jeremyf/devise-multi_auth.png?branch=master)](https://travis-ci.org/jeremyf/devise-multi_auth) [![Version](https://badge.fury.io/rb/devise-multi_auth.png)](http://badge.fury.io/rb/devise-multi_auth)
|
2
2
|
|
3
3
|
A [Devise](https://github.com/plataformatec/devise) plugin leveraging [omniauth](https://github.com/intridea/omniauth) to
|
4
4
|
expose alternate means for authenticating existing users.
|
@@ -22,3 +22,7 @@ And then execute:
|
|
22
22
|
$ bundle
|
23
23
|
$ rails generate devise:multi_auth:install
|
24
24
|
```
|
25
|
+
|
26
|
+
## TODO
|
27
|
+
|
28
|
+
At present, this [Rails Engine](http://guides.rubyonrails.org/engines.html) does not expose an obvious means for initiating the connecting between an existing account and an omniauth-enabled account (i.e. login via Github).
|
data/Rakefile
CHANGED
@@ -5,7 +5,11 @@ rescue LoadError
|
|
5
5
|
end
|
6
6
|
|
7
7
|
APP_RAKEFILE = File.expand_path("../spec/internal/Rakefile", __FILE__)
|
8
|
-
|
8
|
+
begin
|
9
|
+
load 'rails/tasks/engine.rake'
|
10
|
+
rescue LoadError
|
11
|
+
puts "Warning: Unable to find #{APP_RAKEFILE}; internal application's tasks will not be loaded."
|
12
|
+
end
|
9
13
|
|
10
14
|
require 'engine_cart/rake_task'
|
11
15
|
|
@@ -18,4 +22,6 @@ RSpec::Core::RakeTask.new(:spec)
|
|
18
22
|
namespace :spec do
|
19
23
|
desc 'Rebuild and run the specs'
|
20
24
|
task :travis => ['engine_cart:clean', 'engine_cart:generate', 'spec']
|
21
|
-
end
|
25
|
+
end
|
26
|
+
|
27
|
+
task :default => :spec
|
data/lib/devise_multi_auth.rb
CHANGED
@@ -10,11 +10,12 @@ module Devise::MultiAuth
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def oauth_client_for(provider_name, config = {})
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
default_args = Devise.omniauth_configs.fetch(provider_name.to_sym).args.dup
|
14
|
+
default_options = default_args.extract_options!
|
15
|
+
options = config.fetch(:options) { default_options[:client_options] || {} }
|
16
|
+
client_id = config.fetch(:client_id) { default_args[0] }
|
17
|
+
secret = config.fetch(:secret) { default_args[1] }
|
18
|
+
OAuth2::Client.new(client_id, secret, options)
|
18
19
|
end
|
19
20
|
|
20
21
|
end
|