From 6e266f8a77db85499c983c8ab64ed3bb802f925e Mon Sep 17 00:00:00 2001 From: Movin Silva Date: Wed, 17 Apr 2024 16:31:18 +0530 Subject: [PATCH] style: :art: remove whitespaces --- lib/src/client.ts | 1 - lib/src/core/authentication-core.ts | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/src/client.ts b/lib/src/client.ts index f6480f2c..a864160c 100644 --- a/lib/src/client.ts +++ b/lib/src/client.ts @@ -104,7 +104,6 @@ export class AsgardeoAuthClient { cryptoUtils: CryptoUtils, instanceID?: number ): Promise { - console.log("Newest Local PACKAGE!!"); const clientId: string = config.clientID; if (!AsgardeoAuthClient._instanceID) { diff --git a/lib/src/core/authentication-core.ts b/lib/src/core/authentication-core.ts index 3a5b5fd7..693fd88e 100644 --- a/lib/src/core/authentication-core.ts +++ b/lib/src/core/authentication-core.ts @@ -75,19 +75,19 @@ export class AuthenticationCore { authorizeRequestParams.set("response_type", "code"); authorizeRequestParams.set("client_id", configData.clientID); - + let scope: string = OIDC_SCOPE; - + if (configData.scope && configData.scope.length > 0) { if (!configData.scope.includes(OIDC_SCOPE)) { configData.scope.push(OIDC_SCOPE); } scope = configData.scope.join(" "); } - + authorizeRequestParams.set("scope", scope); authorizeRequestParams.set("redirect_uri", configData.signInRedirectURL); - + if (configData.responseMode) { authorizeRequestParams.set("response_mode", configData.responseMode); } @@ -109,13 +109,13 @@ export class AuthenticationCore { authorizeRequestParams.set("code_challenge_method", "S256"); authorizeRequestParams.set("code_challenge", codeChallenge); } - + if (configData.prompt) { authorizeRequestParams.set("prompt", configData.prompt); } - + const customParams: AuthorizationURLParams | undefined = config; - + if (customParams) { for (const [ key, value ] of Object.entries(customParams)) { if (key != "" && value != "" && key !== STATE) { @@ -123,7 +123,7 @@ export class AuthenticationCore { } } } - + authorizeRequestParams.set( STATE, AuthenticationUtils.generateStateParamForRequestCorrelation( @@ -149,14 +149,14 @@ export class AuthenticationCore { ); } - const authorizeRequest: URL = new URL(authorizeEndpoint); + const authorizeRequest: URL = new URL(authorizeEndpoint); - const authorizeRequestParams: Map = + const authorizeRequestParams: Map = await this.getAuthorizationURLParams(config, userID); - for (const [ key, value ] of authorizeRequestParams.entries()) { - authorizeRequest.searchParams.append(key, value); - } + for (const [ key, value ] of authorizeRequestParams.entries()) { + authorizeRequest.searchParams.append(key, value); + } return authorizeRequest.toString(); }