sync_attr_with_auth0 0.0.13 → 0.0.14

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: ad39e17ebaa360e7b5755a13cf8accf7843abba3
4
- data.tar.gz: 9037b53718a5a4ddd22da02266a438645cb7ef2a
3
+ metadata.gz: 0b4c90d565c0bcaf4fa8b929320b0aa1a5c066e6
4
+ data.tar.gz: fde7fe0f1445c8c7dcdd4a842e81edc4f041ae8e
5
5
  SHA512:
6
- metadata.gz: f038ebbd02435ba03edb40c0d09fa03b7c80c4367c65d2c4fc3a5f3a91dc0e005c8b443ad3ad317ff23c206489a3a04a5dfcba8f0200bd96f97107a38aff53a9
7
- data.tar.gz: d8a3a29eb4f664d1888413aea263946f06e2c62c1a3de7db2087da316bb963b019f1a447a2538a8e9e4b66f8639a778f9078c16fff12f49107626c1aada4e7d1
6
+ metadata.gz: d1aeec3b8019ebcd2593eeae4c0a87b794d2e7cfac906c15e6dfb1721695e5ccc1cb6bcaafc363e41c5fca82bd155e9ca711c6a8e68b0a7bda85e03201b2656c
7
+ data.tar.gz: f321cc9825122ab90ac486d169525199ae14d010d0cb932a1cc50146294f010d99748af9761ae3c97e0cd5c1df294c302140b28d6613d0f73f6cd6801425602f
@@ -27,6 +27,7 @@ module SyncAttrWithAuth0
27
27
  email_att: :email,
28
28
  password_att: :password,
29
29
  email_verified_att: :email_verified,
30
+ verify_password_att: :verify_password,
30
31
  connection_name: 'Username-Password-Authentication',
31
32
  sync_atts: []
32
33
  }
@@ -113,6 +114,15 @@ module SyncAttrWithAuth0
113
114
  }
114
115
  }
115
116
 
117
+ if (
118
+ auth0_sync_options[:sync_atts].index(auth0_sync_options[:password_att]) and
119
+ self.send("#{auth0_sync_options[:password_att]}_changed?")
120
+ )
121
+ # The password should be sync'd and was changed
122
+ args['password'] = self.send(auth0_sync_options[:password_att])
123
+ args['verify_password'] = auth0_verify_password?
124
+ end
125
+
116
126
  args['user_metadata'] = user_metadata
117
127
 
118
128
  response = auth0.patch_user(uid, args)
@@ -131,6 +141,10 @@ module SyncAttrWithAuth0
131
141
  !!(self.respond_to?(auth0_sync_options[:email_verified_att]) ? self.send(auth0_sync_options[:email_verified_att]) : false)
132
142
  end
133
143
 
144
+ def auth0_verify_password?
145
+ !!(self.respond_to?(auth0_sync_options[:verify_password_att]) ? self.send(auth0_sync_options[:verify_password_att]) : true)
146
+ end
147
+
134
148
  def auth0_default_password
135
149
  # Need a9 or something similar to guarantee one letter and one number in the password
136
150
  "#{auth0_new_uuid[0..19]}a9"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sync_attr_with_auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McGraw
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  requirements: []
168
168
  rubyforge_project:
169
- rubygems_version: 2.4.6
169
+ rubygems_version: 2.2.2
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Synchronize attributes on a local ActiveRecord user model with the user metadata