devise_pam_authenticatable2 6.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/VERSION +1 -1
- data/devise_pam_authenticatable2.gemspec +2 -2
- data/lib/devise_pam_authenticatable/model.rb +15 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5745cc55b3ccebdf26683d92c40f957763aa11427c857ae389c3a9ab4ff68f6b
|
4
|
+
data.tar.gz: a6fe0983a958d2e9bacd098d5896eba3af22f4fd7871c23e0f0aa69b335b8361
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ff5f1a174b2f0aed9022f6c9ba137fbaa98eec91c168a622773cd702a21b1e1e3092e287d4059961137f8ab7b4b8f246a945fd0bbefac88fa58fdb8a5d413a0
|
7
|
+
data.tar.gz: 28f19cf3c0d2db216d5671744d5ec8d885d7806b747718169f91db34d47f1f0d6c299a3a4beb03febef903c22a9b5b3533d9a79fd1399bdf8c3d4508cbfe9f54
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.1.0
|
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: devise_pam_authenticatable2 6.
|
5
|
+
# stub: devise_pam_authenticatable2 6.1.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "devise_pam_authenticatable2".freeze
|
9
|
-
s.version = "6.
|
9
|
+
s.version = "6.1.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
@@ -62,8 +62,7 @@ module Devise
|
|
62
62
|
module ClassMethods
|
63
63
|
Devise::Models.config(self, :pam_service, :pam_suffix)
|
64
64
|
|
65
|
-
def
|
66
|
-
return nil unless attributes[:password]
|
65
|
+
def pam_find_user(attributes = {})
|
67
66
|
if ::Devise.usernamefield && attributes[:username]
|
68
67
|
resource = find_by(::Devise.usernamefield => attributes[:username])
|
69
68
|
|
@@ -71,9 +70,13 @@ module Devise
|
|
71
70
|
resource = new
|
72
71
|
resource[::Devise.usernamefield] = attributes[:username]
|
73
72
|
end
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
return resource
|
74
|
+
elsif ::Devise.emailfield && attributes[:email]
|
75
|
+
if ::Devise.check_at_sign && ::Devise.usernamefield && attributes[:email].index('@').nil?
|
76
|
+
resource = find_by(::Devise.usernamefield => attributes[:email])
|
77
|
+
else
|
78
|
+
resource = find_by(::Devise.emailfield => attributes[:email])
|
79
|
+
end
|
77
80
|
|
78
81
|
if resource.blank?
|
79
82
|
resource = new
|
@@ -84,9 +87,14 @@ module Devise
|
|
84
87
|
resource[::Devise.emailfield] = attributes[:email]
|
85
88
|
end
|
86
89
|
end
|
87
|
-
|
88
|
-
return nil
|
90
|
+
return resource
|
89
91
|
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def authenticate_with_pam(attributes = {})
|
95
|
+
return nil unless attributes[:password]
|
96
|
+
|
97
|
+
return nil unless (resource = pam_find_user(attributes))
|
90
98
|
|
91
99
|
# potential conflict detected
|
92
100
|
resource = resource.pam_conflict(attributes) if resource.pam_conflict?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_pam_authenticatable2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Wilson
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
78
|
+
rubygems_version: 2.7.3
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Devise PAM authentication module using rpam2
|