dailycred 0.1.41 → 0.1.42
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/dailycred.gemspec +1 -1
- data/dummy/config/initializers/omniauth.rb +0 -11
- data/lib/dailycred/acts_as_dailycred.rb +2 -4
- data/lib/dailycred/middleware.rb +1 -1
- data/lib/generators/dailycred_generator.rb +1 -1
- data/lib/generators/templates/migration_create_user.rb +3 -1
- data/spec/omniauth/strategies/dailycred_spec.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -56,7 +56,7 @@ To use a social sign-in service instead of email, and password, use `connect_pat
|
|
56
56
|
|
57
57
|
<%= link_to 'sign in with facebook', connect_path(:identity_provider => :facebook) %>
|
58
58
|
|
59
|
-
The `identity_provider` can be one of `facebook`, `google`, or `
|
59
|
+
The `identity_provider` can be one of `facebook`, `google`, `twitter`, `disqus`, or `instagram`.
|
60
60
|
|
61
61
|
After a user has social connected, their social data is serialized into individual fields in the user model. The serialized object is the exact same as what the social provider's graph response returns. For example:
|
62
62
|
|
@@ -160,7 +160,7 @@ To easily build referral URLs to track sharing amongst your users, use `referral
|
|
160
160
|
Testing controllers that have the `authenticate` before filter is easy:
|
161
161
|
|
162
162
|
# with mocha
|
163
|
-
@controller.
|
163
|
+
@controller.stubs(:current_user).returns(@user)
|
164
164
|
|
165
165
|
See `dummy/test/functional/post_controller_test.rb` for an example.
|
166
166
|
|
data/dailycred.gemspec
CHANGED
@@ -1,13 +1,2 @@
|
|
1
1
|
Rails.configuration.DAILYCRED_CLIENT_ID = "4133a23f-b9c3-47e4-8989-cfb30510079d"
|
2
2
|
Rails.configuration.DAILYCRED_SECRET_KEY = "a1c21e72-98d8-47c2-9e9a-1e2dcd363b2f-f353b2af-1f51-416c-ad4c-59e70721dfab"
|
3
|
-
|
4
|
-
# configure where users should be redirected after authentication
|
5
|
-
|
6
|
-
Rails.configuration.DAILYCRED_OPTIONS = {
|
7
|
-
:client_options => {
|
8
|
-
:site => 'http://ec2-72-44-40-55.compute-1.amazonaws.com:9000',
|
9
|
-
:verbose => true
|
10
|
-
}
|
11
|
-
# :after_auth => '/hello', #after login
|
12
|
-
# :after_unauth => '/goodbye' #after logout
|
13
|
-
}
|
@@ -7,6 +7,7 @@ module ActsAsDailycred
|
|
7
7
|
serialize :tags, Array
|
8
8
|
serialize :referred, Array
|
9
9
|
serialize :access_tokens, Hash
|
10
|
+
serialize :idenitities, Hash
|
10
11
|
|
11
12
|
extend ActsAsDailycred::SingletonMethods
|
12
13
|
include ActsAsDailycred::InstanceMethods
|
@@ -42,15 +43,11 @@ module ActsAsDailycred
|
|
42
43
|
|
43
44
|
def display_name
|
44
45
|
display = self.email || ""
|
45
|
-
p '1'
|
46
46
|
if self.facebook != {}
|
47
|
-
p '2'
|
48
47
|
return self.facebook["name"]
|
49
48
|
elsif self.google != {}
|
50
|
-
p '3'
|
51
49
|
return self.google["name"]
|
52
50
|
elsif self.twitter != {}
|
53
|
-
p '4'
|
54
51
|
return "@"+self.twitter["screen_name"]
|
55
52
|
end
|
56
53
|
display
|
@@ -65,6 +62,7 @@ module ActsAsDailycred
|
|
65
62
|
|
66
63
|
def update_from_dailycred dc
|
67
64
|
bad = ['updated_at', 'created_at']
|
65
|
+
p dc
|
68
66
|
dc.each do |k,v|
|
69
67
|
self[k] = v if self.respond_to?(k) and !bad.include?(k.to_s)
|
70
68
|
end
|
data/lib/dailycred/middleware.rb
CHANGED
@@ -15,7 +15,6 @@ module Dailycred
|
|
15
15
|
def call(env)
|
16
16
|
@env = env
|
17
17
|
@status, @headers, @response = @app.call(env)
|
18
|
-
|
19
18
|
if @headers["Content-Type"] =~ /text\/html|application\/xhtml\+xml/
|
20
19
|
body = ""
|
21
20
|
@response.each { |part| body << part }
|
@@ -41,6 +40,7 @@ module Dailycred
|
|
41
40
|
window.dc_opts = {
|
42
41
|
clientId: "#{@client_id}",
|
43
42
|
home: "#{@opts[:url]}"
|
43
|
+
#{", type: \"#{@status.to_s}\"" if @status == 500 || @status == 400}
|
44
44
|
};
|
45
45
|
dc = document.createElement("script");
|
46
46
|
url = dc_opts.home + "/public/js/cred.coffee";
|
@@ -72,7 +72,7 @@ class DailycredGenerator < Rails::Generators::Base
|
|
72
72
|
# url = "https://www.dailycred.com"
|
73
73
|
# url = "http://localhost:9000"
|
74
74
|
# staging server for a very short time
|
75
|
-
url = "
|
75
|
+
url = "https://www.dailycred.com"
|
76
76
|
connection = Faraday::Connection.new url, :ssl => ssl_opts
|
77
77
|
params = {
|
78
78
|
:login => email,
|
@@ -5,7 +5,7 @@ class CreateUsers < ActiveRecord::Migration
|
|
5
5
|
t.string :provider
|
6
6
|
t.string :uid
|
7
7
|
t.string :email
|
8
|
-
t.
|
8
|
+
t.bigint :created
|
9
9
|
t.string :username
|
10
10
|
t.boolean :verified
|
11
11
|
t.boolean :admin
|
@@ -20,6 +20,7 @@ class CreateUsers < ActiveRecord::Migration
|
|
20
20
|
t.text :access_tokens
|
21
21
|
t.boolean :subscribed
|
22
22
|
t.string :display
|
23
|
+
t.text :identities
|
23
24
|
|
24
25
|
t.timestamps
|
25
26
|
end
|
@@ -42,6 +43,7 @@ class CreateUsers < ActiveRecord::Migration
|
|
42
43
|
safe_column :users, :access_tokens, :text
|
43
44
|
safe_column :users, :display, :string
|
44
45
|
safe_column :users, :subscribed, :boolean
|
46
|
+
safe_column :users, :identities, :text
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
@@ -23,7 +23,7 @@ describe OmniAuth::Strategies::Dailycred do
|
|
23
23
|
subject.client.site.should eq("https://www.dailycred.com")
|
24
24
|
end
|
25
25
|
it 'should have the correct authorization url' do
|
26
|
-
subject.client.options[:authorize_url].should eq("/
|
26
|
+
subject.client.options[:authorize_url].should eq("/connect")
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'should have the correct token url' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dailycred
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.42
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|