Skip to content

Commit

Permalink
style: 🎨 remove whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
movinsilva committed Apr 17, 2024
1 parent 643ec7b commit 6e266f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion lib/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export class AsgardeoAuthClient<T> {
cryptoUtils: CryptoUtils,
instanceID?: number
): Promise<void> {
console.log("Newest Local PACKAGE!!");
const clientId: string = config.clientID;

if (!AsgardeoAuthClient._instanceID) {
Expand Down
26 changes: 13 additions & 13 deletions lib/src/core/authentication-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ export class AuthenticationCore<T> {

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);
}
Expand All @@ -109,21 +109,21 @@ export class AuthenticationCore<T> {
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) {
authorizeRequestParams.set(key, value.toString());
}
}
}

authorizeRequestParams.set(
STATE,
AuthenticationUtils.generateStateParamForRequestCorrelation(
Expand All @@ -149,14 +149,14 @@ export class AuthenticationCore<T> {
);
}

const authorizeRequest: URL = new URL(authorizeEndpoint);
const authorizeRequest: URL = new URL(authorizeEndpoint);

const authorizeRequestParams: Map<string, string> =
const authorizeRequestParams: Map<string, string> =
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();
}
Expand Down

0 comments on commit 6e266f8

Please sign in to comment.