authem 1.2.0 → 1.3.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/config.rb +9 -1
- data/lib/authem/user.rb +11 -0
- data/lib/authem/version.rb +1 -1
- data/lib/generators/authem/model/model_generator.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4765b564d8e774dc0d83e5c841f55d3af7e9a86e
|
4
|
+
data.tar.gz: 182578f7f5d5f1ee61c9226d9bd7cf6519c43a8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d7b862cdff6b1ff28ebb0923c794de9554364b6158581cd95e3ff77f4986d3b459c7a57354876a00dfeb98ac7c657050253e7374370eb9f3f7c5ba3670ba25
|
7
|
+
data.tar.gz: 5d37428e8e35871a71b9db9dd79a345875179e641e24b1ca6a759edb0af32337345a30455a1eeb649590557df9ca1892ea73ffd86891dbc4620ba78b16f4a178
|
data/lib/authem/config.rb
CHANGED
@@ -2,12 +2,20 @@ module Authem
|
|
2
2
|
module Config
|
3
3
|
extend self
|
4
4
|
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :sign_in_path
|
6
6
|
|
7
7
|
Authem::Config.sign_in_path ||= :sign_in
|
8
8
|
|
9
9
|
def configure
|
10
10
|
yield self
|
11
11
|
end
|
12
|
+
|
13
|
+
def user_class
|
14
|
+
@user_class.constantize
|
15
|
+
end
|
16
|
+
|
17
|
+
def user_class=(user_class)
|
18
|
+
@user_class = user_class.to_s
|
19
|
+
end
|
12
20
|
end
|
13
21
|
end
|
data/lib/authem/user.rb
CHANGED
@@ -6,5 +6,16 @@ module Authem::User
|
|
6
6
|
Authem::Config.user_class = self
|
7
7
|
|
8
8
|
has_secure_password
|
9
|
+
|
10
|
+
alias_method :original_authenticate, :authenticate
|
11
|
+
|
12
|
+
def authenticate(password)
|
13
|
+
if password.present?
|
14
|
+
original_authenticate(password)
|
15
|
+
else
|
16
|
+
false
|
17
|
+
end
|
18
|
+
end
|
9
19
|
end
|
20
|
+
|
10
21
|
end
|
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("model #{model_name} email:string
|
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
|
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.3.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-
|
11
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -156,7 +156,8 @@ files:
|
|
156
156
|
- README.markdown
|
157
157
|
- Rakefile
|
158
158
|
homepage: https://github.com/paulelliott/authem
|
159
|
-
licenses:
|
159
|
+
licenses:
|
160
|
+
- WTFPL
|
160
161
|
metadata: {}
|
161
162
|
post_install_message:
|
162
163
|
rdoc_options: []
|
@@ -174,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
175
|
version: '0'
|
175
176
|
requirements: []
|
176
177
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.
|
178
|
+
rubygems_version: 2.1.3
|
178
179
|
signing_key:
|
179
180
|
specification_version: 4
|
180
181
|
summary: Authem authenticates them by email
|