wizdog 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9e2e4e8884ccdd801328f1a8d14618491587495
4
- data.tar.gz: 9c5fc3b1c4e7d3237ee029dac1ea1325371a1dc3
3
+ metadata.gz: 4150c3b2fcc321ddb7ffbe7e7ca81c5bd7e70f41
4
+ data.tar.gz: 4e9de22f2b67382c6501900b2bb7792c21b1b9c5
5
5
  SHA512:
6
- metadata.gz: 36532dc5c62c5596207c70d8ce71689f1aa1ff74a026be27f1c1a0739a98d335f8dc83bafa968ae6acf11c99f31bbc577de1d1322718905b444b916effdb8e15
7
- data.tar.gz: c009edab7db4301de04c468f8715650c803ac30d7e677426bde41c190de2822bd83342c73e86d7974e70449b95fa5fd1c70848233a18710ccedaf9a3e3469d77
6
+ metadata.gz: d881a1d3acbb8a9a3fa87e2edae7308f162ed0ffa0afce153f9033417cd5555163537dab3cce833f211ca2b05b18c624d9e957e2f5e526a66cf67cd808a57482
7
+ data.tar.gz: 2d70b51cf93ad7f8e8d67da8891d328f302361091a3a340b39911367cb1a4bd0589e6ca0188281b3eee9bf5f83ca9cdcf3b4c9325da105d59c0028cf503273d1
@@ -30,15 +30,17 @@ module WizAuthc
30
30
  # def get_realm_map
31
31
  # @@realm_map
32
32
  # end
33
- #overide
34
- def find_one_by_principal(principal)
33
+ #
34
+ def find_by_principal(principal)
35
35
  where(:login => principal).first
36
36
  end
37
37
 
38
38
  def authenticate(principal=nil, credential=nil, remembered = false)
39
- user = find_one_by_principal(principal)
40
- p user
41
- p principal
39
+ if respond_to?(:find_one_by_principal)
40
+ user = find_one_by_principal(principal)
41
+ else
42
+ user = find_by_principal(principal)
43
+ end
42
44
  user && user.authenticate(credential) ? user : nil
43
45
  end
44
46
 
@@ -1,3 +1,3 @@
1
1
  module Wizdog
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wizdog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - songgz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2016-04-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Flexible authentication solution for Rails
14
14
  email: