authpwn_rails 0.10.8 → 0.10.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -2
- data/VERSION +1 -1
- data/authpwn_rails.gemspec +1 -1
- data/lib/authpwn_rails/generators/templates/session/new.html.erb +3 -0
- data/lib/authpwn_rails/generators/templates/session/password_change.html.erb +4 -0
- data/lib/authpwn_rails/session_controller.rb +11 -11
- data/test/session_controller_api_test.rb +6 -6
- metadata +19 -19
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.9
|
data/authpwn_rails.gemspec
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
<% if flash[:notice] %>
|
4
4
|
<p class="notice"><%= flash[:notice] %></p>
|
5
5
|
<% end %>
|
6
|
+
<% if flash[:alert] %>
|
7
|
+
<p class="alert"><%= flash[:alert] %></p>
|
8
|
+
<% end %>
|
9
|
+
|
6
10
|
|
7
11
|
<%= form_for @credential, :url => change_password_session_path,
|
8
12
|
:as => :credential, :method => :post do |f| %>
|
@@ -71,12 +71,12 @@ module SessionController
|
|
71
71
|
:csrf => form_authenticity_token }
|
72
72
|
end
|
73
73
|
else
|
74
|
-
|
74
|
+
error_text = bounce_notice_text auth
|
75
75
|
format.html do
|
76
|
-
redirect_to new_session_url, :flash => { :
|
76
|
+
redirect_to new_session_url, :flash => { :alert => error_text,
|
77
77
|
:auth_redirect_url => @redirect_url }
|
78
78
|
end
|
79
|
-
format.json { render :json => { :error => auth, :text =>
|
79
|
+
format.json { render :json => { :error => auth, :text => error_text } }
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
@@ -94,14 +94,14 @@ module SessionController
|
|
94
94
|
respond_to do |format|
|
95
95
|
if user
|
96
96
|
format.html do
|
97
|
-
redirect_to new_session_url, :
|
97
|
+
redirect_to new_session_url, :alert =>
|
98
98
|
'Please check your e-mail for instructions'
|
99
99
|
end
|
100
100
|
format.json { render :json => { } }
|
101
101
|
else
|
102
|
-
|
102
|
+
error_text = 'Invalid e-mail'
|
103
103
|
format.html do
|
104
|
-
redirect_to new_session_url, :
|
104
|
+
redirect_to new_session_url, :alert => error_text
|
105
105
|
end
|
106
106
|
format.json do
|
107
107
|
render :json => { :error => :not_found, :text => notice }
|
@@ -119,13 +119,13 @@ module SessionController
|
|
119
119
|
end
|
120
120
|
|
121
121
|
if auth.is_a? Symbol
|
122
|
-
|
123
|
-
respond_to do |format|
|
122
|
+
error_text = bounce_notice_text auth
|
123
|
+
respond_to do |format|
|
124
124
|
format.html do
|
125
|
-
redirect_to new_session_url, :flash => { :
|
125
|
+
redirect_to new_session_url, :flash => { :alert => error_text,
|
126
126
|
:auth_redirect_url => session_url }
|
127
127
|
end
|
128
|
-
format.json { render :json => { :error => auth, :text =>
|
128
|
+
format.json { render :json => { :error => auth, :text => error_text } }
|
129
129
|
end
|
130
130
|
else
|
131
131
|
self.current_user = auth
|
@@ -190,7 +190,7 @@ module SessionController
|
|
190
190
|
success = @credential.update_attributes params[:credential]
|
191
191
|
else
|
192
192
|
success = false
|
193
|
-
flash[:
|
193
|
+
flash[:alert] = 'Incorrect old password. Please try again.'
|
194
194
|
end
|
195
195
|
else
|
196
196
|
@credential = Credentials::Password.new params[:credential]
|
@@ -105,7 +105,7 @@ class SessionControllerApiTest < ActionController::TestCase
|
|
105
105
|
assert_redirected_to new_session_url
|
106
106
|
assert_nil assigns(:current_user), 'instance variable'
|
107
107
|
assert_nil session_current_user, 'session'
|
108
|
-
assert_match(/Invalid/, flash[:
|
108
|
+
assert_match(/Invalid/, flash[:alert])
|
109
109
|
end
|
110
110
|
|
111
111
|
test "create does not log in blocked accounts" do
|
@@ -115,7 +115,7 @@ class SessionControllerApiTest < ActionController::TestCase
|
|
115
115
|
assert_redirected_to new_session_url
|
116
116
|
assert_nil assigns(:current_user), 'instance variable'
|
117
117
|
assert_nil session_current_user, 'session'
|
118
|
-
assert_match(/ blocked/, flash[:
|
118
|
+
assert_match(/ blocked/, flash[:alert])
|
119
119
|
end
|
120
120
|
|
121
121
|
test "create by json does not log in with bad password" do
|
@@ -147,7 +147,7 @@ class SessionControllerApiTest < ActionController::TestCase
|
|
147
147
|
post :create, :email => @email_credential.email, :password => 'fail',
|
148
148
|
:redirect_url => url
|
149
149
|
assert_redirected_to new_session_url
|
150
|
-
|
150
|
+
assert_match(/Invalid /, flash[:alert])
|
151
151
|
assert_equal url, flash[:auth_redirect_url]
|
152
152
|
end
|
153
153
|
|
@@ -156,7 +156,7 @@ class SessionControllerApiTest < ActionController::TestCase
|
|
156
156
|
assert_redirected_to new_session_url
|
157
157
|
assert_nil assigns(:current_user), 'instance variable'
|
158
158
|
assert_nil session_current_user, 'session'
|
159
|
-
|
159
|
+
assert_match(/Invalid /, flash[:alert])
|
160
160
|
end
|
161
161
|
|
162
162
|
test "token logs in with good token" do
|
@@ -191,7 +191,7 @@ class SessionControllerApiTest < ActionController::TestCase
|
|
191
191
|
assert_redirected_to new_session_url
|
192
192
|
assert_nil assigns(:current_user), 'instance variable'
|
193
193
|
assert_nil session_current_user, 'session'
|
194
|
-
assert_match(/Invalid/, flash[:
|
194
|
+
assert_match(/Invalid/, flash[:alert])
|
195
195
|
end
|
196
196
|
|
197
197
|
test "token does not log in blocked accounts" do
|
@@ -203,7 +203,7 @@ class SessionControllerApiTest < ActionController::TestCase
|
|
203
203
|
assert_redirected_to new_session_url
|
204
204
|
assert_nil assigns(:current_user), 'instance variable'
|
205
205
|
assert_nil session_current_user, 'session'
|
206
|
-
assert_match(/ blocked/, flash[:
|
206
|
+
assert_match(/ blocked/, flash[:alert])
|
207
207
|
end
|
208
208
|
|
209
209
|
test "token by json does not log in with random token" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authpwn_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-07 00:00:00.
|
12
|
+
date: 2012-02-07 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fbgraph_rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &22640120 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.2.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *22640120
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &22638700 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.2.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *22638700
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
38
|
-
requirement: &
|
38
|
+
requirement: &22638040 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *22638040
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: flexmock
|
49
|
-
requirement: &
|
49
|
+
requirement: &22637400 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.9.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *22637400
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &22636660 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.8.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *22636660
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rcov
|
71
|
-
requirement: &
|
71
|
+
requirement: &22636020 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *22636020
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov
|
82
|
-
requirement: &
|
82
|
+
requirement: &22635420 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *22635420
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: sqlite3
|
93
|
-
requirement: &
|
93
|
+
requirement: &22634800 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: 1.3.5
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *22634800
|
102
102
|
description: Works with Facebook.
|
103
103
|
email: victor@costan.us
|
104
104
|
executables: []
|
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
segments:
|
205
205
|
- 0
|
206
|
-
hash:
|
206
|
+
hash: -4411019045775612342
|
207
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
208
|
none: false
|
209
209
|
requirements:
|