edge-auth 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.first(conditions: {email: email})
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.first(conditions: {_id: id})
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.exists?(conditions: { salt: salt })
103
+ end while Identity.where({ salt: salt }).exists?
107
104
  return salt
108
105
  end
109
106
 
@@ -1,3 +1,3 @@
1
1
  module EdgeAuth
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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.3
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-03-30 00:00:00.000000000 Z
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: &11725220 !ruby/object:Gem::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: *11725220
24
+ version_requirements: *5839260
25
25
  description: EdgeAuth is an authentication solution
26
26
  email:
27
27
  - dan.persa@gmail.com