diff --git a/src/authutil.ts b/src/authutil.ts index a4df3d80..50065068 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -36,11 +36,15 @@ async function getAuthToken( }); 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 + */ let body: string = await response.readBody(); - core.info(body); - let data: any = 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; } async function writeRegistryToFile(