Skip to content

Commit 6cc94ab

Browse files
committed
chore: prettier fix
1 parent f07053d commit 6cc94ab

File tree

9 files changed

+40
-36
lines changed

9 files changed

+40
-36
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Changelog
22

3-
43
## b6bda8a4ff4564a6ae8fd8e180f3b57d2eaa5eb6...main
54

65
[compare changes](https://github.com/kinde-oss/kinde-typescript-sdk/compare/b6bda8a4ff4564a6ae8fd8e180f3b57d2eaa5eb6...main)
@@ -39,4 +38,3 @@
3938
## 2.7.0...2.7.0
4039

4140
[compare changes](https://github.com/kinde-oss/kinde-typescript-sdk/compare/2.7.0...2.7.0)
42-

lib/__tests__/sdk/utilities/generateRandomString.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ describe('validateClientSecret', () => {
66
expect(result.length).toBe(25);
77
});
88

9-
109
it('should return false for invalid secrets - odd length', () => {
1110
const result = generateRandomString(47);
1211
expect(result.length).toBe(47);
@@ -16,4 +15,4 @@ describe('validateClientSecret', () => {
1615
const result = generateRandomString(50);
1716
expect(result.length).toBe(50);
1817
});
19-
});
18+
});

lib/__tests__/sdk/utilities/validate-client-secret.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ describe('validateClientSecret', () => {
1212
const result = validateClientSecret(invalidSecret);
1313
expect(result).toBe(false);
1414
});
15-
});
15+
});

lib/sdk/clients/browser/authcode-with-pkce.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ import type {
1616
BrowserPKCEClientOptions,
1717
} from '../types.js';
1818

19-
import type {
20-
OAuth2CodeExchangeResponse,
21-
} from '../../oauth2-flows/types.js';
19+
import type { OAuth2CodeExchangeResponse } from '../../oauth2-flows/types.js';
2220

2321
const createAuthCodeWithPKCEClient = (options: BrowserPKCEClientOptions) => {
2422
const { featureFlags, tokenClaims } = utilities;
@@ -271,15 +269,15 @@ const createAuthCodeWithPKCEClient = (options: BrowserPKCEClientOptions) => {
271269
const getToken = async (): Promise<string> => {
272270
return await client.getToken(sessionManager);
273271
};
274-
272+
275273
/**
276274
* Method makes user of the `refreshTokens` method of the `AuthCodeWithPKCE` client
277275
* to use the refresh token to get new tokens
278276
* @returns {Promise<OAuth2CodeExchangeResponse>}
279277
*/
280-
const refreshTokens = async (): Promise<OAuth2CodeExchangeResponse> => {
281-
return await client.refreshTokens(sessionManager);
282-
};
278+
const refreshTokens = async (): Promise<OAuth2CodeExchangeResponse> => {
279+
return await client.refreshTokens(sessionManager);
280+
};
283281

284282
/**
285283
* Method extracts the provided feature flag from the access token in the

lib/sdk/clients/server/authorization-code.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import type {
1111
ACClientOptions,
1212
} from '../types.js';
1313

14-
import type {
15-
OAuth2CodeExchangeResponse,
16-
} from '../../oauth2-flows/types.js';
14+
import type { OAuth2CodeExchangeResponse } from '../../oauth2-flows/types.js';
1715

1816
const createAuthorizationCodeClient = (
1917
options: ACClientOptions,
@@ -143,7 +141,9 @@ const createAuthorizationCodeClient = (
143141
* @param {SessionManager} sessionManager
144142
* @returns {Promise<OAuth2CodeExchangeResponse>}
145143
*/
146-
const refreshTokens = async (sessionManager: SessionManager): Promise<OAuth2CodeExchangeResponse> => {
144+
const refreshTokens = async (
145+
sessionManager: SessionManager
146+
): Promise<OAuth2CodeExchangeResponse> => {
147147
return await client.refreshTokens(sessionManager);
148148
};
149149

lib/sdk/oauth2-flows/AuthCodeAbstract.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export abstract class AuthCodeAbstract {
243243
protected generateAuthURLParams(options: AuthURLOptions = {}): URLSearchParams {
244244
const searchParams = this.getBaseAuthURLParams();
245245

246-
let scope = this.config.scope ?? AuthCodeAbstract.DEFAULT_TOKEN_SCOPES
246+
let scope = this.config.scope ?? AuthCodeAbstract.DEFAULT_TOKEN_SCOPES;
247247
scope = scope.split(' ').includes('openid') ? scope : `${scope} openid`;
248248

249249
let searchParamsObject: Record<string, unknown> = {
@@ -264,17 +264,22 @@ export abstract class AuthCodeAbstract {
264264
}
265265

266266
if (options.authUrlParams) {
267-
const { lang, login_hint: loginHint, connection_id: connectionId, ...rest } = options.authUrlParams;
267+
const {
268+
lang,
269+
login_hint: loginHint,
270+
connection_id: connectionId,
271+
...rest
272+
} = options.authUrlParams;
268273
searchParamsObject = { ...rest, ...searchParamsObject };
269-
274+
270275
if (lang) {
271276
searchParamsObject.lang = lang;
272277
}
273-
278+
274279
if (loginHint) {
275280
searchParamsObject.login_hint = loginHint;
276281
}
277-
282+
278283
if (connectionId) {
279284
searchParamsObject.connection_id = connectionId;
280285
}
@@ -290,12 +295,13 @@ export abstract class AuthCodeAbstract {
290295
}
291296

292297
if (this.config.audience) {
293-
const audienceArray = Array.isArray(this.config.audience) ? this.config.audience : [this.config.audience];
298+
const audienceArray = Array.isArray(this.config.audience)
299+
? this.config.audience
300+
: [this.config.audience];
294301

295-
audienceArray
296-
.forEach((aud) => {
297-
searchParams.append('audience', aud);
298-
});
302+
audienceArray.forEach((aud) => {
303+
searchParams.append('audience', aud);
304+
});
299305
}
300306

301307
return searchParams;

lib/sdk/oauth2-flows/ClientCredentials.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,13 @@ export class ClientCredentials {
121121
}
122122

123123
if (this.config.audience) {
124-
const audienceArray = Array.isArray(this.config.audience) ? this.config.audience : [this.config.audience];
124+
const audienceArray = Array.isArray(this.config.audience)
125+
? this.config.audience
126+
: [this.config.audience];
125127

126-
audienceArray
127-
.forEach((aud) => {
128-
searchParams.append('audience', aud);
129-
});
128+
audienceArray.forEach((aud) => {
129+
searchParams.append('audience', aud);
130+
});
130131
}
131132

132133
return new URLSearchParams(searchParams);

lib/sdk/utilities/random-string.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ export const generateRandomString = (length: number = 28): string => {
99
const bytesNeeded = Math.ceil(length / 2);
1010
const array = new Uint32Array(bytesNeeded);
1111
getRandomValues(array);
12-
let result = Array.from(array, (dec) => ('0' + dec.toString(16)).slice(-2)).join('');
12+
let result = Array.from(array, (dec) => ('0' + dec.toString(16)).slice(-2)).join(
13+
''
14+
);
1315
if (length % 2 !== 0) {
1416
// If the requested length is odd, remove the last character to adjust the length
1517
result = result.slice(0, -1);
1618
}
1719
return result;
18-
};
20+
};
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Validates that the supplied client secret is in the correct format.
33
* @param {string} secret
4-
* @returns {boolean}
4+
* @returns {boolean}
55
*/
66
export const validateClientSecret = (secret: string): boolean => {
7-
return !!secret.match('^[a-zA-Z0-9]{40,60}$')?.length
8-
};
7+
return !!secret.match('^[a-zA-Z0-9]{40,60}$')?.length;
8+
};

0 commit comments

Comments
 (0)