From 5afccaa9dbe7dcaebf10fd572f0a07bd0a2d49e8 Mon Sep 17 00:00:00 2001 From: Sourav Chanduka Date: Thu, 29 Jul 2021 12:48:27 +0530 Subject: [PATCH] removed whitespaces --- packages/oidc-client/src/main.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/oidc-client/src/main.ts b/packages/oidc-client/src/main.ts index 31ea1637..60c88762 100644 --- a/packages/oidc-client/src/main.ts +++ b/packages/oidc-client/src/main.ts @@ -4,10 +4,8 @@ import {IHeaders} from '@actions/http-client/interfaces' import {createHttpClient, isSuccessStatusCode} from './internal/utils' import {getIDTokenUrl} from './internal/config-variables' -async function postCall( - id_token_url: string, - audience: string -): Promise { +async function postCall(id_token_url: string, audience: string): Promise { + const httpclient = createHttpClient() if (httpclient === undefined) { throw new Error(`Failed to get Httpclient `) @@ -16,10 +14,8 @@ async function postCall( core.debug(`Httpclient created ${httpclient} `) // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true const additionalHeaders: IHeaders = {} - additionalHeaders[actions_http_client.Headers.ContentType] = - actions_http_client.MediaTypes.ApplicationJson - additionalHeaders[actions_http_client.Headers.Accept] = - actions_http_client.MediaTypes.ApplicationJson + additionalHeaders[actions_http_client.Headers.ContentType] = actions_http_client.MediaTypes.ApplicationJson + additionalHeaders[actions_http_client.Headers.Accept] = actions_http_client.MediaTypes.ApplicationJson core.debug(`audience is ${audience !== null ? audience : 'null'}`) @@ -56,10 +52,9 @@ export async function getIDToken(audience: string): Promise { core.debug(`ID token url is ${id_token_url}`) let body: string = await postCall(id_token_url, audience) - let id_token = parseJson(body) - return id_token + } catch (error) { core.setFailed(error.message) return error.message