user_authentication 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/application_controller.rb +2 -2
- data/app/controllers/users_controller.rb +16 -3
- data/config/routes.rb +1 -0
- data/lib/user_authentication/version.rb +1 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6426ee5790ceed405afdbe0fe48a3e10d7fcffb
|
4
|
+
data.tar.gz: 860ff4cffc4435d8e28a4f40f625afe7eb8bc1f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 526a67e1cc0914b4b91b17c4a79e0258474d559f7a81a0aa4e5c3907baa62137ba8f645cc975b1a4774865737ad1a7ddf2b3b44eaccc6eac52775a9eb887d644
|
7
|
+
data.tar.gz: a89ea4aa16cb3c8acc76bc00cc689f182bdf6b22d13b83ab5ff48162aa6717b312a228bb28d6272df84ef54f20a3824e184e7215638d1d746ff763cc57d98d1c
|
@@ -4,8 +4,8 @@ class ApplicationController < ActionController::Base
|
|
4
4
|
# private
|
5
5
|
|
6
6
|
def authorize
|
7
|
-
# Not using
|
8
|
-
#
|
7
|
+
# Not using skip_before_filter, since main app could inadvertently override that, for example,
|
8
|
+
# by using a before_filter in its application_controller.
|
9
9
|
if params[:controller] == 'users' && ['login', 'logout', 'signup'].include?(params[:action])
|
10
10
|
return true
|
11
11
|
end
|
@@ -1,7 +1,6 @@
|
|
1
|
-
controller = File.join Rails.root, 'app/controllers/users_controller.rb'
|
2
|
-
require controller if File.exists? controller
|
3
|
-
|
4
1
|
class UsersController < ApplicationController
|
2
|
+
before_filter :authorize, only: [:set_password]
|
3
|
+
|
5
4
|
def login
|
6
5
|
user = User.find_by_email params[:email]
|
7
6
|
if user && user.authenticate(params[:password])
|
@@ -47,4 +46,18 @@ class UsersController < ApplicationController
|
|
47
46
|
redirect_to :back, alert: 'Please check email and password.'
|
48
47
|
end
|
49
48
|
end
|
49
|
+
|
50
|
+
def set_password
|
51
|
+
current_user.password = params[:password]
|
52
|
+
current_user.save
|
53
|
+
|
54
|
+
if respond_to? :on_set_password
|
55
|
+
on_set_password
|
56
|
+
else
|
57
|
+
redirect_to :back
|
58
|
+
end
|
59
|
+
end
|
50
60
|
end
|
61
|
+
|
62
|
+
controller = File.join Rails.root, 'app/controllers/users_controller.rb'
|
63
|
+
require controller if File.exists? controller
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sujoy Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ruby-openid
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.3.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.3.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: sqlite3
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,7 +172,8 @@ files:
|
|
158
172
|
- MIT-LICENSE
|
159
173
|
- Rakefile
|
160
174
|
homepage: http://github.com/sujoyg/user_authentication
|
161
|
-
licenses:
|
175
|
+
licenses:
|
176
|
+
- MIT
|
162
177
|
metadata: {}
|
163
178
|
post_install_message:
|
164
179
|
rdoc_options: []
|