Skip to content

Commit ceb5ee8

Browse files
romanbalayanRoman Balayan
andauthored
fix: remove unused state option in exchangeWebFlowCode() (#52)
Co-authored-by: Roman Balayan <[email protected]>
1 parent 4d86a2d commit ceb5ee8

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -459,17 +459,6 @@ Options
459459
The <code>redirectUrl</code> option you passed to <a href="#getwebflowauthorizationurl"><code>getWebFlowAuthorizationUrl()</code></a>
460460
</td>
461461
</tr>
462-
<tr>
463-
<th>
464-
<code>state</code>
465-
</th>
466-
<th>
467-
<code>string</code>
468-
</th>
469-
<td>
470-
The <code>state</code> option you passed to <a href="#getwebflowauthorizationurl"><code>getWebFlowAuthorizationUrl()</code></a>
471-
</td>
472-
</tr>
473462
<tr>
474463
<th>
475464
<code>request</code>

src/exchange-web-flow-code.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export type ExchangeWebFlowCodeOAuthAppOptions = {
1818
clientSecret: string;
1919
code: string;
2020
redirectUrl?: string;
21-
state?: string;
2221
request?: RequestInterface;
2322
};
2423
export type ExchangeWebFlowCodeGitHubAppOptions = {
@@ -27,7 +26,6 @@ export type ExchangeWebFlowCodeGitHubAppOptions = {
2726
clientSecret: string;
2827
code: string;
2928
redirectUrl?: string;
30-
state?: string;
3129
request?: RequestInterface;
3230
};
3331

@@ -77,7 +75,6 @@ export async function exchangeWebFlowCode(
7775
client_secret: options.clientSecret,
7876
code: options.code,
7977
redirect_uri: options.redirectUrl,
80-
state: options.state,
8178
}
8279
);
8380

test/exchange-web-flow-code.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ describe("exchangeWebFlowCode()", () => {
2121
client_id: "1234567890abcdef1234",
2222
client_secret: "1234567890abcdef12347890abcdef12345678",
2323
code: "code123",
24-
state: "state123",
2524
},
2625
}
2726
);
@@ -31,7 +30,6 @@ describe("exchangeWebFlowCode()", () => {
3130
clientId: "1234567890abcdef1234",
3231
clientSecret: "1234567890abcdef12347890abcdef12345678",
3332
code: "code123",
34-
state: "state123",
3533
request: request.defaults({
3634
headers: {
3735
"user-agent": "test",
@@ -78,7 +76,6 @@ describe("exchangeWebFlowCode()", () => {
7876
client_id: "1234567890abcdef1234",
7977
client_secret: "1234567890abcdef12347890abcdef12345678",
8078
code: "code123",
81-
state: "state123",
8279
},
8380
}
8481
);
@@ -88,7 +85,6 @@ describe("exchangeWebFlowCode()", () => {
8885
clientId: "1234567890abcdef1234",
8986
clientSecret: "1234567890abcdef12347890abcdef12345678",
9087
code: "code123",
91-
state: "state123",
9288
request: request.defaults({
9389
headers: {
9490
"user-agent": "test",
@@ -138,7 +134,6 @@ describe("exchangeWebFlowCode()", () => {
138134
client_id: "1234567890abcdef1234",
139135
client_secret: "1234567890abcdef12347890abcdef12345678",
140136
code: "code123",
141-
state: "state123",
142137
redirect_uri: "https://acme-inc.com/login",
143138
},
144139
}
@@ -149,7 +144,6 @@ describe("exchangeWebFlowCode()", () => {
149144
clientId: "1234567890abcdef1234",
150145
clientSecret: "1234567890abcdef12347890abcdef12345678",
151146
code: "code123",
152-
state: "state123",
153147
redirectUrl: "https://acme-inc.com/login",
154148
request: request.defaults({
155149
headers: {
@@ -198,7 +192,6 @@ describe("exchangeWebFlowCode()", () => {
198192
client_id: "lv1.1234567890abcdef",
199193
client_secret: "1234567890abcdef12347890abcdef12345678",
200194
code: "code123",
201-
state: "state123",
202195
redirect_uri: "https://acme-inc.com/login",
203196
},
204197
}
@@ -209,7 +202,6 @@ describe("exchangeWebFlowCode()", () => {
209202
clientId: "lv1.1234567890abcdef",
210203
clientSecret: "1234567890abcdef12347890abcdef12345678",
211204
code: "code123",
212-
state: "state123",
213205
redirectUrl: "https://acme-inc.com/login",
214206
request: request.defaults({
215207
headers: {
@@ -265,7 +257,6 @@ describe("exchangeWebFlowCode()", () => {
265257
client_id: "lv1.1234567890abcdef",
266258
client_secret: "1234567890abcdef12347890abcdef12345678",
267259
code: "code123",
268-
state: "state123",
269260
},
270261
}
271262
);
@@ -275,7 +266,6 @@ describe("exchangeWebFlowCode()", () => {
275266
clientId: "lv1.1234567890abcdef",
276267
clientSecret: "1234567890abcdef12347890abcdef12345678",
277268
code: "code123",
278-
state: "state123",
279269
request: request.defaults({
280270
headers: {
281271
"user-agent": "test",

0 commit comments

Comments
 (0)