fix error

This commit is contained in:
邱博亞 2022-01-24 12:59:59 +08:00
parent 44df301aca
commit a2ec4b9334
1 changed files with 1 additions and 1 deletions

View File

@ -12,11 +12,11 @@ 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
req.read_timeout = 3000
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.read_timeout = 3
res = http.request(req)
if res.code == '200' && JSON.load(res.body)["userID"]==ldap_user