easy_auth 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -42,10 +42,10 @@ module EasyAuth::Controllers::PasswordReset
|
|
42
42
|
def after_successful_password_reset(identity)
|
43
43
|
identity.set_account_session(session)
|
44
44
|
identity.update_attribute(:reset_token, nil)
|
45
|
-
redirect_to
|
45
|
+
redirect_to after_successful_password_reset_url(identity), :notice => I18n.t('easy_auth.password_reset.update.notice')
|
46
46
|
end
|
47
47
|
|
48
|
-
def
|
48
|
+
def after_successful_password_reset_url(identity)
|
49
49
|
identity.account
|
50
50
|
end
|
51
51
|
|
@@ -25,10 +25,10 @@ module EasyAuth::Controllers::Sessions
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def after_successful_sign_in(identity)
|
28
|
-
redirect_to session.delete(:requested_path) ||
|
28
|
+
redirect_to session.delete(:requested_path) || after_successful_sign_in_url(identity), :notice => I18n.t('easy_auth.sessions.create.notice')
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
31
|
+
def after_successful_sign_in_url(identity)
|
32
32
|
identity.account
|
33
33
|
end
|
34
34
|
|
@@ -38,6 +38,6 @@ module EasyAuth::Controllers::Sessions
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def after_sign_out
|
41
|
-
redirect_to main_app.
|
41
|
+
redirect_to main_app.root_url, :notice => I18n.t('easy_auth.sessions.delete.notice')
|
42
42
|
end
|
43
43
|
end
|
@@ -4,16 +4,21 @@ module EasyAuth::Models::Identity
|
|
4
4
|
belongs_to :account, :polymorphic => true
|
5
5
|
has_secure_password
|
6
6
|
attr_accessible :username, :password, :password_confirmation, :remember
|
7
|
+
validates :username, :uniqueness => true, :presence => true
|
8
|
+
validates :password, :presence => { :on => :create }
|
9
|
+
extend ClassMethods
|
10
|
+
end
|
11
|
+
end
|
7
12
|
|
8
|
-
|
9
|
-
|
13
|
+
module ClassMethods
|
14
|
+
def authenticate(attributes = nil)
|
15
|
+
return nil if attributes.nil?
|
10
16
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
+
if identity = where(arel_table[:username].matches(attributes[:username].try(&:strip))).first.try(:authenticate, attributes[:password])
|
18
|
+
identity.remember = attributes[:remember]
|
19
|
+
identity
|
20
|
+
else
|
21
|
+
nil
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
data/lib/easy_auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,15 @@ dependencies:
|
|
22
22
|
version: 3.2.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 3.2.1
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: bcrypt-ruby
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ~>
|
@@ -33,10 +38,15 @@ dependencies:
|
|
33
38
|
version: 3.0.0
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.0.0
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: sqlite3
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ! '>='
|
@@ -44,10 +54,15 @@ dependencies:
|
|
44
54
|
version: '0'
|
45
55
|
type: :development
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: rspec-rails
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ! '>='
|
@@ -55,10 +70,15 @@ dependencies:
|
|
55
70
|
version: '0'
|
56
71
|
type: :development
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
59
79
|
- !ruby/object:Gem::Dependency
|
60
80
|
name: capybara
|
61
|
-
requirement:
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
62
82
|
none: false
|
63
83
|
requirements:
|
64
84
|
- - ! '>='
|
@@ -66,10 +86,15 @@ dependencies:
|
|
66
86
|
version: '0'
|
67
87
|
type: :development
|
68
88
|
prerelease: false
|
69
|
-
version_requirements:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
70
95
|
- !ruby/object:Gem::Dependency
|
71
96
|
name: capybara-email
|
72
|
-
requirement:
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
73
98
|
none: false
|
74
99
|
requirements:
|
75
100
|
- - ! '>='
|
@@ -77,10 +102,15 @@ dependencies:
|
|
77
102
|
version: '0'
|
78
103
|
type: :development
|
79
104
|
prerelease: false
|
80
|
-
version_requirements:
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
81
111
|
- !ruby/object:Gem::Dependency
|
82
112
|
name: valid_attribute
|
83
|
-
requirement:
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
84
114
|
none: false
|
85
115
|
requirements:
|
86
116
|
- - ! '>='
|
@@ -88,10 +118,15 @@ dependencies:
|
|
88
118
|
version: '0'
|
89
119
|
type: :development
|
90
120
|
prerelease: false
|
91
|
-
version_requirements:
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
92
127
|
- !ruby/object:Gem::Dependency
|
93
128
|
name: factory_girl_rails
|
94
|
-
requirement:
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
95
130
|
none: false
|
96
131
|
requirements:
|
97
132
|
- - ! '>='
|
@@ -99,10 +134,15 @@ dependencies:
|
|
99
134
|
version: '0'
|
100
135
|
type: :development
|
101
136
|
prerelease: false
|
102
|
-
version_requirements:
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
103
143
|
- !ruby/object:Gem::Dependency
|
104
144
|
name: bourne
|
105
|
-
requirement:
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
106
146
|
none: false
|
107
147
|
requirements:
|
108
148
|
- - ! '>='
|
@@ -110,10 +150,15 @@ dependencies:
|
|
110
150
|
version: '0'
|
111
151
|
type: :development
|
112
152
|
prerelease: false
|
113
|
-
version_requirements:
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
114
159
|
- !ruby/object:Gem::Dependency
|
115
160
|
name: launchy
|
116
|
-
requirement:
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
117
162
|
none: false
|
118
163
|
requirements:
|
119
164
|
- - ! '>='
|
@@ -121,10 +166,15 @@ dependencies:
|
|
121
166
|
version: '0'
|
122
167
|
type: :development
|
123
168
|
prerelease: false
|
124
|
-
version_requirements:
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ! '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
125
175
|
- !ruby/object:Gem::Dependency
|
126
176
|
name: debugger
|
127
|
-
requirement:
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
128
178
|
none: false
|
129
179
|
requirements:
|
130
180
|
- - ! '>='
|
@@ -132,7 +182,12 @@ dependencies:
|
|
132
182
|
version: '0'
|
133
183
|
type: :development
|
134
184
|
prerelease: false
|
135
|
-
version_requirements:
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
136
191
|
description: EasyAuth
|
137
192
|
email:
|
138
193
|
- brian@dockyard.com
|
@@ -185,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
185
240
|
version: '0'
|
186
241
|
segments:
|
187
242
|
- 0
|
188
|
-
hash:
|
243
|
+
hash: 409473676038941757
|
189
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
245
|
none: false
|
191
246
|
requirements:
|
@@ -194,10 +249,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
249
|
version: '0'
|
195
250
|
segments:
|
196
251
|
- 0
|
197
|
-
hash:
|
252
|
+
hash: 409473676038941757
|
198
253
|
requirements: []
|
199
254
|
rubyforge_project:
|
200
|
-
rubygems_version: 1.8.
|
255
|
+
rubygems_version: 1.8.23
|
201
256
|
signing_key:
|
202
257
|
specification_version: 3
|
203
258
|
summary: EasyAuth
|