in lib/res_cli/cli.rb [28:53]
def self.backend_login(username, password)
url = 'https://server.resilientdb.com/getUser'
encrypted_password = BCrypt::Password.create(password)
payload = { email: username, password: password }
response = HTTPX.post(url, json: payload)
case response.status
when 200
body = response.to_s
json_response = JSON.parse(body)
if json_response['success'] == true
return true
else
return false
end
when 500
return false
else
return false
end
rescue HTTPX::Error => e
false
end