Skip to content

Commit

Permalink
fix(chore): fixed sonar issue
Browse files Browse the repository at this point in the history
fixed sonar issue

GH-125
  • Loading branch information
Karunesh Mani Tripathi committed Nov 21, 2023
1 parent aecef18 commit 7a6dd07
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-misused-promises */
// SONAR-IGNORE-ALL
import {inject, Provider} from '@loopback/core';
import {HttpErrors, Request} from '@loopback/rest';
Expand Down Expand Up @@ -39,22 +40,21 @@ export class ClientPasswordStrategyFactoryProvider
// do nothing
}
}
// sonarignore:start
//prettier-ignore-start
// prettier-ignore
getClientPasswordVerifier(
options?: ClientPasswordStrategy.StrategyOptionsWithRequestInterface,
verifierPassed?: VerifyFunction.OauthClientPasswordFn,
): ClientPasswordStrategy.Strategy {
const verifyFn = verifierPassed ?? this.verifier;
if (options?.passReqToCallback) {
return new ClientPasswordStrategy.Strategy(
// eslint-disable-next-line @typescript-eslint/no-misused-promises
async (
clientId: string,
clientSecret: string | undefined,
cb: (err: Error | null, client?: IAuthClient | null) => void,
req: Request | undefined,
) => {
//NOSONAR
) => { //NOSONAR
try {
const client = await verifyFn(clientId, clientSecret, req);
this.clientPasswordVerifierHelper(client, clientSecret);
Expand All @@ -67,13 +67,11 @@ export class ClientPasswordStrategyFactoryProvider
);
} else {
return new ClientPasswordStrategy.Strategy(
// eslint-disable-next-line @typescript-eslint/no-misused-promises
async (
clientId: string,
clientSecret: string | undefined,
cb: (err: Error | null, client?: IAuthClient | null) => void,
) => {
//NOSONAR
) => { //NOSONAR
try {
const client = await verifyFn(clientId, clientSecret);
this.clientPasswordVerifierHelper(client, clientSecret);
Expand All @@ -85,5 +83,5 @@ export class ClientPasswordStrategyFactoryProvider
);
}
}
// sonarignore:end
//prettier-ignore-end
}

0 comments on commit 7a6dd07

Please sign in to comment.