model_driven_api 3.3.1 → 3.4.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ecd0e3a3b7a279fb9a68b6ac3fe513ada2aa9875807cc672fa5a8f4d690fb1d
|
4
|
+
data.tar.gz: 926640daa632265835dc91e24d4062ed3678c91972aa5d6de53c2c8939511c4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa235f9c25f6abcb48d724f68f9a726bf38c1dd90bd7aab6c292fdf78ecab4df142f806337b6782595ba19484481d230020880e2376ed44f62d207f736026acd
|
7
|
+
data.tar.gz: 984146f876ba9b9267855f9099a316641efbd65131191e680e933ccbeb013d3bac51ec287c41e9a886a815f312866f579fcf0a8d3cb795e7b1b6538960b5e058
|
@@ -37,6 +37,9 @@ class AuthenticateUser
|
|
37
37
|
user = nil if user.blank? || user.authenticate(password).blank?
|
38
38
|
end
|
39
39
|
|
40
|
+
#Try to authenticate the user against LDAP if user is not present at this point
|
41
|
+
user = Ldap::Authenticator.new(email: email, password: password).authenticate if user.blank?
|
42
|
+
|
40
43
|
raise AccessDenied unless user.present?
|
41
44
|
|
42
45
|
return user
|
@@ -87,8 +87,10 @@ class Api::V2::ApplicationController < ActionController::API
|
|
87
87
|
return render json: result, status: (status_number.presence || 200) if status == true
|
88
88
|
|
89
89
|
# Normal Update Action
|
90
|
-
#
|
91
|
-
|
90
|
+
# Use save! to be sure to raise an exception if the record is not valid and to trigger all the callbacks for the model during update
|
91
|
+
Rails.logger.debug("############################## Updating record #{@record}")
|
92
|
+
@record.update!(@body)
|
93
|
+
|
92
94
|
render json: @record.to_json(json_attrs), status: 200
|
93
95
|
end
|
94
96
|
|