summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/system_recovery_endpoint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/endpoints/system_recovery_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/system_recovery_endpoint.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef_zero/endpoints/system_recovery_endpoint.rb b/lib/chef_zero/endpoints/system_recovery_endpoint.rb
index 0ad2293..0f77a8c 100644
--- a/lib/chef_zero/endpoints/system_recovery_endpoint.rb
+++ b/lib/chef_zero/endpoints/system_recovery_endpoint.rb
@@ -10,13 +10,13 @@ module ChefZero
name = request_json["username"]
password = request_json["password"]
user = get_data(request, request.rest_path[0..-2] + ["users", name], :nil)
- if !user
+ unless user
raise RestErrorResponse.new(403, "Nonexistent user")
end
user = FFI_Yajl::Parser.parse(user)
user = ChefData::DataNormalizer.normalize_user(user, name, [ "username" ], server.options[:osc_compat])
- if !user["recovery_authentication_enabled"]
+ unless user["recovery_authentication_enabled"]
raise RestErrorResponse.new(403, "Only users with recovery_authentication_enabled=true may use /system_recovery to log in")
end
if user["password"] != password