 
 module.exports = (robot) ->
   robot.respond /ghe (status|info)? ?(.*)$/i, (msg) ->
-    url = process.env.HUBOT_GHE_URL
-    user = process.env.HUBOT_GHE_USERNAME
-    pass = process.env.HUBOT_GHE_PASSWORD
-    auth = 'Basic ' + new Buffer(user + ':' + pass).toString("base64")
+    url = process.env.HUBOT_GHE_URL + '/api/v3'
+    token = process.env.HUBOT_GHE_TOKEN
 
-    unless user
-      msg.send "user isn't set."
-
-    unless pass
-      msg.send "pass isn't set."
-
-    unless auth
-      msg.send "auth isn't set."
+    unless token
+      msg.send "token isn't set."
 
     info_term = msg.match[2]
     if info_term is "license"

    else
      msg.send "I don't know about #{info_term}"

ghe_license = (msg, auth,url) ->
    msg.http("#{url}/enterprise/settings/license")
    .header("Authorization", auth)
    .get() (err, res, body) ->
        if err
             msg.send "error"

#
# Configuration:
#   HUBOT_GHE_URL
#   HUBOT_GHE_TOKEN
#
# Commands:
#   hubot ghe (status|info) <info> - gives some information about large repositories
