authem 1.3.3 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authem.rb +5 -6
- data/lib/authem/base_user.rb +7 -9
- data/lib/authem/controller_support.rb +1 -1
- data/lib/authem/sorcery_user.rb +2 -2
- data/lib/authem/token.rb +3 -3
- data/lib/authem/version.rb +1 -1
- data/lib/generators/authem/model/model_generator.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfadf2e98145044611efbc8cf9c464bf61ff5a4a
|
4
|
+
data.tar.gz: 7711f61516b8011719f3bef3227db9a6c2d69a07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1645715ffabda3d2ccc4a246e2e1bfd8b7e84fee7fada613bf2960718a1948d3b69e42f6507b8a48a16c482a5f9ff6f3d99c7276197638325c5505a29786cf1
|
7
|
+
data.tar.gz: 4525dcad2f1a248e498e62447b6bc622a022ec30cfe428bd1d20a41cd35c79337f0cf249e184405caa03e2a33faa6bbb0b8aae5d9130d10607ef219bf0757a8f
|
data/lib/authem.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
module Authem
|
2
|
-
autoload :BaseUser,
|
3
|
-
autoload :User,
|
4
|
-
autoload :SorceryUser,
|
5
|
-
|
6
|
-
autoload :Config, 'authem/config'
|
2
|
+
autoload :BaseUser, 'authem/base_user'
|
3
|
+
autoload :User, 'authem/user'
|
4
|
+
autoload :SorceryUser, 'authem/sorcery_user'
|
5
|
+
autoload :Config, 'authem/config'
|
7
6
|
autoload :ControllerSupport, 'authem/controller_support'
|
8
|
-
autoload :Token,
|
7
|
+
autoload :Token, 'authem/token'
|
9
8
|
|
10
9
|
def self.configure(&block)
|
11
10
|
Config.configure(&block)
|
data/lib/authem/base_user.rb
CHANGED
@@ -22,7 +22,7 @@ module Authem::BaseUser
|
|
22
22
|
|
23
23
|
def reset_password(password, confirmation)
|
24
24
|
if password.blank?
|
25
|
-
self.errors.add
|
25
|
+
self.errors.add :password, :blank
|
26
26
|
return false
|
27
27
|
end
|
28
28
|
|
@@ -32,20 +32,18 @@ module Authem::BaseUser
|
|
32
32
|
self.password_confirmation = confirmation
|
33
33
|
self.reset_password_token = nil
|
34
34
|
|
35
|
-
if save
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
false
|
40
|
-
end
|
35
|
+
return true if save
|
36
|
+
|
37
|
+
self.reset_password_token = reset_password_token
|
38
|
+
false
|
41
39
|
end
|
42
40
|
|
43
41
|
def reset_password_token!
|
44
|
-
generate_token
|
42
|
+
generate_token :reset_password
|
45
43
|
end
|
46
44
|
|
47
45
|
def reset_session_token!
|
48
|
-
generate_token
|
46
|
+
generate_token :session
|
49
47
|
end
|
50
48
|
|
51
49
|
private
|
data/lib/authem/sorcery_user.rb
CHANGED
@@ -5,8 +5,8 @@ module Authem::SorceryUser
|
|
5
5
|
included do
|
6
6
|
attr_accessor :password, :password_confirmation
|
7
7
|
validates_presence_of :password, on: :create
|
8
|
-
validates_presence_of :password_confirmation, if: ->
|
9
|
-
validates_confirmation_of :password, if: ->
|
8
|
+
validates_presence_of :password_confirmation, if: ->{ password.present? }
|
9
|
+
validates_confirmation_of :password, if: ->{ password.present? }
|
10
10
|
|
11
11
|
before_save :encrypt_password
|
12
12
|
end
|
data/lib/authem/token.rb
CHANGED
data/lib/authem/version.rb
CHANGED
@@ -6,7 +6,7 @@ module Authem
|
|
6
6
|
argument :model_name, type: :string, default: "user"
|
7
7
|
|
8
8
|
def generate_model
|
9
|
-
generate
|
9
|
+
generate "model #{model_name} email:string password_digest:string reset_password_token:string session_token:string remember_token:string"
|
10
10
|
end
|
11
11
|
|
12
12
|
def update_model_to_include_authem
|
@@ -15,7 +15,7 @@ module Authem
|
|
15
15
|
|
16
16
|
def add_initializer
|
17
17
|
create_file 'config/initializers/authem.rb' do
|
18
|
-
|
18
|
+
"Authem.configure do |config|\n config.user_class = #{model_name.camelize}\nend"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Elliott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: sqlite3
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '>='
|
@@ -167,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
167
|
requirements:
|
168
168
|
- - '>='
|
169
169
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
170
|
+
version: 1.9.3
|
171
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
173
|
- - '>='
|