multiauth 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/multiauth/views_helper.rb +11 -6
- data/multiauth.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Multiauth
|
2
2
|
module ViewsHelper
|
3
|
-
def multiauth_box(url = nil)
|
3
|
+
def multiauth_box(resource_name, url = nil)
|
4
4
|
url = session_path(resource_name) if !url
|
5
5
|
|
6
|
-
form_for(
|
6
|
+
form_for(resource_name, :url => url, :html => {:id => "openid"}) do |f|
|
7
7
|
%@<div id="nojsopenid">#{f.text_field(:identity_url, :id => "identity_url")}#{f.submit('Sign in')}</div>@+
|
8
8
|
render(:partial => "multiauth/box")
|
9
9
|
end
|
@@ -15,13 +15,18 @@ module Multiauth
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def multiauth_providers
|
18
|
+
mapping = request.env["devise.mapping"]
|
18
19
|
providers = Multiauth::PROVIDERS
|
19
|
-
if
|
20
|
-
providers.delete("Facebook")
|
21
|
-
providers.delete("Github")
|
22
|
-
else
|
20
|
+
if mapping && mapping.oauthable?
|
23
21
|
providers.delete("Facebook") if !resource_class.oauth_providers.include?(:facebook)
|
24
22
|
providers.delete("Github") if !resource_class.oauth_providers.include?(:github)
|
23
|
+
else
|
24
|
+
providers.delete("Facebook")
|
25
|
+
providers.delete("Github")
|
26
|
+
end
|
27
|
+
|
28
|
+
if user_signed_in?
|
29
|
+
providers["Twitter"][:url] = '/users/connect/twitter'
|
25
30
|
end
|
26
31
|
|
27
32
|
providers
|
data/multiauth.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{multiauth}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David A. Cuadrado"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-25}
|
13
13
|
s.description = %q{multi authentication gem using devise & co}
|
14
14
|
s.email = %q{krawek@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- David A. Cuadrado
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-25 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|