simple_token_authentication 1.0.0.pre.beta.3 → 1.0.0.pre.beta.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9390fdbcabdaa8aa202484a679525e231d235f2e
4
- data.tar.gz: f41c87d33fe1c4493f784953251ac72ee3de901e
3
+ metadata.gz: a5f92320f3e16de67b816c98fb1925f1e3be9208
4
+ data.tar.gz: d77a7d869343f4ab58e2cb454283f08a5c15204c
5
5
  SHA512:
6
- metadata.gz: 8a73d97f45c59d2fa77ac719ed829f304f49e897a281d04d4c4154214581d2e739a418ac39ac168b12c8543d862b6200eb9d7a5acd0e5e0dc141bc664375aac7
7
- data.tar.gz: 90f6e5762b2885f665e10da724a8ec4d5a08fe4ef9ba640efae8fc7507023ac37e08578e5cee0784f22a2f40c0d2268a9ef1b89edf105647260f9527628dd527
6
+ metadata.gz: ea3e87944d7bb0a08a2e0a55b02f1d0d0d70317c15b365a10d43a140c7d57280b9e97c9366f9074973303a661b4c2be300c8071cdda9b8586cb96b9dccd91664
7
+ data.tar.gz: a07ddf6aa368e1ced4be85fb95eb445ac7bd8445a0765a2757a9df1d421e16c9533354874f46be41c5c2dc7a49c408a22cdb50a28ed105d88f361492ae557e6c
@@ -27,7 +27,12 @@ module SimpleTokenAuthentication
27
27
  end
28
28
 
29
29
  user_email = params[:user_email].presence
30
- user = user_email && User.find_by(email: user_email)
30
+ # See https://github.com/ryanb/cancan/blob/1.6.10/lib/cancan/controller_resource.rb#L108-L111
31
+ if User.respond_to? "find_by"
32
+ user = user_email && User.find_by(email: user_email)
33
+ elsif User.respond_to? "find_by_email"
34
+ user = user_email && User.find_by_email(user_email)
35
+ end
31
36
 
32
37
  # Notice how we use Devise.secure_compare to compare the token
33
38
  # in the database with the token given in the params, mitigating
@@ -1,3 +1,3 @@
1
1
  module SimpleTokenAuthentication
2
- VERSION = "1.0.0-beta.3"
2
+ VERSION = "1.0.0-beta.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_token_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.3
4
+ version: 1.0.0.pre.beta.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo Bulnes Guilpain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2013-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord