From 39ccff2929a6058f6992773d1a695901f2656b9b Mon Sep 17 00:00:00 2001
From: Edward Romero <edward@greenlight.me>
Date: Tue, 23 Jun 2020 20:44:54 -0400
Subject: [PATCH] build code changes

---
 dist/index.js   | 13 ++++++++-----
 src/authutil.ts |  1 -
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dist/index.js b/dist/index.js
index 656fa80f..4bcfb181 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -4722,12 +4722,15 @@ function getAuthToken(authUrl, authUser, authPass) {
             maxRetries: 3
         });
         let response = yield httpClient.get(authUrl);
-        console.log(response);
+        /**
+         * constains string _auth = ***OmV5***\nalways-auth = true
+         * we will parse it by using indexes
+         */
         let body = yield response.readBody();
-        core.info(body);
-        let data = JSON.parse(body);
-        core.info(JSON.stringify(data));
-        return '';
+        const startIndex = body.indexOf('_auth') + 8;
+        const endIndex = body.indexOf('\n');
+        const authToken = body.substring(startIndex, endIndex);
+        return authToken;
     });
 }
 function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
diff --git a/src/authutil.ts b/src/authutil.ts
index 50065068..59035862 100644
--- a/src/authutil.ts
+++ b/src/authutil.ts
@@ -35,7 +35,6 @@ async function getAuthToken(
     maxRetries: 3
   });
   let response: hc.HttpClientResponse = await httpClient.get(authUrl);
-  console.log(response);
   /**
    * constains string _auth = ***OmV5***\nalways-auth = true
    * we will parse it by using indexes