fix error
This commit is contained in:
parent
7ca92d40bd
commit
44df301aca
|
@ -12,9 +12,12 @@ module LdapLogin::Login
|
|||
uri = URI(LDAP_ADSERVER)
|
||||
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
||||
req.body = {AppKey: AppKey,username: ldap_user,password: ldap_pass}.to_json
|
||||
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
|
||||
http.request(req)
|
||||
end
|
||||
req.read_timeout = 3000
|
||||
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
http.use_ssl = true
|
||||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||
res = http.request(req)
|
||||
|
||||
if res.code == '200' && JSON.load(res.body)["userID"]==ldap_user
|
||||
if !user.nil?
|
||||
|
|
Loading…
Reference in New Issue