edge-auth 0.0.3 → 0.0.4
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.
- data/app/models/edge_auth/identity.rb +3 -6
- data/lib/edge-auth/version.rb +1 -1
- metadata +4 -4
@@ -16,9 +16,6 @@ module EdgeAuth
|
|
16
16
|
field :password_reset_code , :type => String
|
17
17
|
field :reset_password_mail_sent_at , :type => DateTime
|
18
18
|
|
19
|
-
|
20
|
-
index :email, unique: true
|
21
|
-
|
22
19
|
attr_accessor :password, :updating_password
|
23
20
|
attr_accessible :email, :password, :password_confirmation, :activation_code
|
24
21
|
|
@@ -54,14 +51,14 @@ module EdgeAuth
|
|
54
51
|
end
|
55
52
|
|
56
53
|
def self.authenticate(email, submitted_password)
|
57
|
-
user = Identity.
|
54
|
+
user = Identity.where(email: email).first
|
58
55
|
return nil if user.nil? or user.state == "blocked"
|
59
56
|
return user if user.has_password?(submitted_password)
|
60
57
|
end
|
61
58
|
|
62
59
|
def self.authenticate_with_salt(id, cookie_salt)
|
63
60
|
return nil if id.nil?
|
64
|
-
user = Identity.
|
61
|
+
user = Identity.where(_id: id).first
|
65
62
|
(user && user.salt == cookie_salt) ? user : nil
|
66
63
|
end
|
67
64
|
|
@@ -103,7 +100,7 @@ module EdgeAuth
|
|
103
100
|
begin
|
104
101
|
salt = secure_hash("#{Time.now.utc}--#{password}--#{SecureRandom.urlsafe_base64}")
|
105
102
|
user = Identity.where(salt: salt)
|
106
|
-
end while Identity.
|
103
|
+
end while Identity.where({ salt: salt }).exists?
|
107
104
|
return salt
|
108
105
|
end
|
109
106
|
|
data/lib/edge-auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edge-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
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-
|
12
|
+
date: 2012-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &5839260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 3.2.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *5839260
|
25
25
|
description: EdgeAuth is an authentication solution
|
26
26
|
email:
|
27
27
|
- dan.persa@gmail.com
|