Skip to content

Commit eff28e6

Browse files
committed
chore: lint
1 parent 3243c4e commit eff28e6

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

lib/utils/exchangeAuthCode.test.ts

+17-18
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ describe("exhangeAuthCode", () => {
134134
StorageKeys.codeVerifier,
135135
);
136136
expect(postCodeVerifier).toBeNull();
137-
expect(fetchMock).toHaveBeenCalledTimes(1);
138-
const [url, options] = fetchMock.mock.calls[0];
139-
expect(url).toBe("http://test.kinde.com/oauth2/token");
140-
expect(options).toMatchObject({
141-
method: "POST",
142-
headers: {
143-
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8",
144-
},
137+
expect(fetchMock).toHaveBeenCalledTimes(1);
138+
const [url, options] = fetchMock.mock.calls[0];
139+
expect(url).toBe("http://test.kinde.com/oauth2/token");
140+
expect(options).toMatchObject({
141+
method: "POST",
142+
headers: {
143+
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8",
144+
},
145145
});
146146
});
147147

@@ -180,16 +180,15 @@ describe("exhangeAuthCode", () => {
180180
redirectURL: "http://test.kinde.com",
181181
});
182182

183-
expect(fetchMock).toHaveBeenCalledTimes(1);
184-
const [url, options] = fetchMock.mock.calls[0];
185-
expect(url).toBe("http://test.kinde.com/oauth2/token");
186-
expect(options).toMatchObject({
187-
method: "POST",
188-
headers: {
189-
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8",
190-
"Kinde-SDK": "Framework/Version",
191-
},
183+
expect(fetchMock).toHaveBeenCalledTimes(1);
184+
const [url, options] = fetchMock.mock.calls[0];
185+
expect(url).toBe("http://test.kinde.com/oauth2/token");
186+
expect(options).toMatchObject({
187+
method: "POST",
188+
headers: {
189+
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8",
190+
"Kinde-SDK": "Framework/Version",
191+
},
192192
});
193193
});
194-
195194
});

lib/utils/exchangeAuthCode.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { getActiveStorage, StorageKeys } from "../main";
22

3-
export const frameworkSettings: { framework: string; frameworkVersion: string } = {
3+
export const frameworkSettings: {
4+
framework: string;
5+
frameworkVersion: string;
6+
} = {
47
framework: "",
58
frameworkVersion: "",
69
};
@@ -62,12 +65,13 @@ export const exchangeAuthCode = async ({
6265
StorageKeys.codeVerifier,
6366
)) as string;
6467

65-
const headers: { 'Content-type': string, "Kinde-SDK"?: string } = {
68+
const headers: { "Content-type": string; "Kinde-SDK"?: string } = {
6669
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8",
67-
}
70+
};
6871

6972
if (frameworkSettings.framework) {
70-
headers["Kinde-SDK"] = `${frameworkSettings.framework}/${frameworkSettings.frameworkVersion}`
73+
headers["Kinde-SDK"] =
74+
`${frameworkSettings.framework}/${frameworkSettings.frameworkVersion}`;
7175
}
7276

7377
const response = await fetch(`${domain}/oauth2/token`, {

lib/utils/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { mapLoginMethodParamsForUrl } from "./mapLoginMethodParamsForUrl";
88
import { exchangeAuthCode, frameworkSettings } from "./exchangeAuthCode";
99

1010
export {
11-
// config
11+
// config
1212
frameworkSettings,
1313

1414
// utils

0 commit comments

Comments
 (0)