bpluser 0.0.16 → 0.0.17
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 +4 -4
- data/app/models/bpluser/user.rb +3 -6
- data/app/models/bpluser/validatable.rb +2 -4
- data/lib/bpluser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb775c6f5f9d7b6b08b89d81a52321b32f80afe7
|
4
|
+
data.tar.gz: de3c3214f82ad04d79d7bde0a9040caddd985eca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 018fc293c23d773338eef2284ef556e50b0678079ce5810858dabfc3f454307e05cd694c3d34a8222a1d1fd6a694197d6534b7c96176b402df7c1b6e14c2a0bc
|
7
|
+
data.tar.gz: 9bbce1dc2c4a2605be3402f887273290970872a759b55e63003957111b291c90e3af12ab4c4666ccc5b83e238b8eb6d61614cc0aac0a3d6cb6c4cd692d48d7a8
|
data/app/models/bpluser/user.rb
CHANGED
@@ -11,6 +11,9 @@ module Bpluser::User
|
|
11
11
|
base.extend(ClassMethods)
|
12
12
|
base.send :include, InstanceMethods
|
13
13
|
|
14
|
+
#Include custom validation that doesn't require email to be uniqe. Based on: https://github.com/plataformatec/devise/blob/master/lib/devise/models/validatable.rb
|
15
|
+
base.send :include, Bpluser::Validatable
|
16
|
+
|
14
17
|
end
|
15
18
|
|
16
19
|
module ClassMethods
|
@@ -20,7 +23,6 @@ module Bpluser::User
|
|
20
23
|
ldap_raw_details = auth_response[:extra][:raw_info]
|
21
24
|
ldap_info_details = auth_response[:info]
|
22
25
|
|
23
|
-
puts 'IN LDAP OAUTH'
|
24
26
|
puts ldap_raw_details.samaccountname[0].downcase
|
25
27
|
|
26
28
|
user = User.where(:provider => auth_response.provider, :uid => ldap_raw_details.samaccountname[0].downcase).first
|
@@ -62,15 +64,11 @@ module Bpluser::User
|
|
62
64
|
end
|
63
65
|
|
64
66
|
def find_for_polaris_oauth(auth_response, signed_in_resource=nil)
|
65
|
-
debug_user_logger = Logger.new('log/digital_stacks_create.log')
|
66
|
-
debug_user_logger.level = Logger::DEBUG
|
67
|
-
|
68
67
|
polaris_raw_details = auth_response[:extra][:raw_info]
|
69
68
|
polaris_info_details = auth_response[:info]
|
70
69
|
|
71
70
|
user = User.where(:provider => auth_response.provider, :uid => auth_response[:uid]).first
|
72
71
|
|
73
|
-
debug_user_logger.debug "User from exist check is: #{user.to_yaml}"
|
74
72
|
#first_name:ldap_info_details.first_name,
|
75
73
|
#last_name:ldap_info_details.last_name,
|
76
74
|
unless user
|
@@ -87,7 +85,6 @@ module Bpluser::User
|
|
87
85
|
)
|
88
86
|
user.save!
|
89
87
|
|
90
|
-
debug_user_logger.debug "User from create check is: #{user.to_yaml}"
|
91
88
|
end
|
92
89
|
user
|
93
90
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#By default, devise requires an email to be unique. I want the email checks but need to remove the uniqueness...
|
2
|
-
module
|
2
|
+
module Bpluser::Validatable
|
3
3
|
# Validatable creates all needed validations for a user email and password.
|
4
4
|
# It's optional, given you may want to create the validations by yourself.
|
5
5
|
# Automatically validate if the email is present, unique and its format is
|
@@ -12,7 +12,6 @@ module BplUser
|
|
12
12
|
# * +email_regexp+: the regular expression used to validate e-mails;
|
13
13
|
# * +password_length+: a range expressing password length. Defaults to 8..72.
|
14
14
|
#
|
15
|
-
module Validatable
|
16
15
|
# All validations used by this module.
|
17
16
|
VALIDATIONS = [:validates_presence_of, :validates_format_of,
|
18
17
|
:validates_confirmation_of, :validates_length_of].freeze
|
@@ -61,5 +60,4 @@ module BplUser
|
|
61
60
|
module ClassMethods
|
62
61
|
::Devise::Models.config(self, :email_regexp, :password_length)
|
63
62
|
end
|
64
|
-
end
|
65
|
-
end
|
63
|
+
end
|
data/lib/bpluser/version.rb
CHANGED