devise-login-cookie 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module DeviseLoginCookie
13
13
  end
14
14
 
15
15
  def authenticate!
16
- if fresh?(cookie) && validate(resource)
16
+ if fresh?(cookie) && resource && validate(resource)
17
17
  success!(resource)
18
18
  else
19
19
  pass
@@ -33,7 +33,8 @@ module DeviseLoginCookie
33
33
  end
34
34
 
35
35
  def resource
36
- @resource ||= mapping.to.find(cookie.id)
36
+ # returns nil when user is missing.
37
+ @resource ||= mapping.to.where(:id => cookie.id)
37
38
  end
38
39
 
39
40
  def pass
@@ -1,3 +1,3 @@
1
1
  module DeviseLoginCookie
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Paul Annesley
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-09 00:00:00 +11:00
17
+ date: 2011-01-20 00:00:00 +11:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency