@octokit/oauth-app
Advanced tools
Comparing version 3.6.2 to 3.6.3
@@ -68,3 +68,3 @@ 'use strict'; | ||
const VERSION = "3.6.2"; | ||
const VERSION = "3.6.3"; | ||
@@ -519,4 +519,4 @@ function addEventHandler(state, eventName, eventHandler) { | ||
if (!query.state || !query.code) { | ||
throw new Error('[@octokit/oauth-app] Both "code" & "state" parameters are required'); | ||
if (!query.code) { | ||
throw new Error('[@octokit/oauth-app] "code" parameter is required'); | ||
} | ||
@@ -529,3 +529,2 @@ | ||
} = await app.createToken({ | ||
state: query.state, | ||
code: query.code | ||
@@ -546,3 +545,2 @@ }); | ||
const { | ||
state: oauthState, | ||
code, | ||
@@ -552,8 +550,7 @@ redirectUrl | ||
if (!oauthState || !code) { | ||
throw new Error('[@octokit/oauth-app] Both "code" & "state" parameters are required'); | ||
if (!code) { | ||
throw new Error('[@octokit/oauth-app] "code" parameter is required'); | ||
} | ||
const result = await app.createToken({ | ||
state: oauthState, | ||
code, | ||
@@ -560,0 +557,0 @@ redirectUrl |
@@ -67,7 +67,6 @@ // @ts-ignore - requires esModuleInterop flag | ||
} | ||
if (!query.state || !query.code) { | ||
throw new Error('[@octokit/oauth-app] Both "code" & "state" parameters are required'); | ||
if (!query.code) { | ||
throw new Error('[@octokit/oauth-app] "code" parameter is required'); | ||
} | ||
const { authentication: { token }, } = await app.createToken({ | ||
state: query.state, | ||
code: query.code, | ||
@@ -86,8 +85,7 @@ }); | ||
if (route === routes.createToken) { | ||
const { state: oauthState, code, redirectUrl } = json; | ||
if (!oauthState || !code) { | ||
throw new Error('[@octokit/oauth-app] Both "code" & "state" parameters are required'); | ||
const { code, redirectUrl } = json; | ||
if (!code) { | ||
throw new Error('[@octokit/oauth-app] "code" parameter is required'); | ||
} | ||
const result = await app.createToken({ | ||
state: oauthState, | ||
code, | ||
@@ -94,0 +92,0 @@ redirectUrl, |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "3.6.2"; | ||
export const VERSION = "3.6.3"; |
import { OAuthApp } from "../../index"; | ||
import { HandlerOptions } from "../types"; | ||
export declare function createCloudflareHandler(app: OAuthApp, { pathPrefix, onUnhandledRequest, }?: HandlerOptions & { | ||
export declare function createCloudflareHandler<T>(app: OAuthApp<T>, { pathPrefix, onUnhandledRequest, }?: HandlerOptions & { | ||
onUnhandledRequest?: (request: Request) => Response | Promise<Response>; | ||
}): (request: Request) => Promise<Response>; |
import { OAuthApp } from "../index"; | ||
import { OctokitRequest, OctokitResponse, HandlerOptions } from "./types"; | ||
import { HandlerOptions, OctokitRequest, OctokitResponse } from "./types"; | ||
import { ClientType, Options } from "../types"; | ||
export declare function handleRequest(app: OAuthApp<Options<ClientType>>, { pathPrefix }: HandlerOptions, request: OctokitRequest): Promise<OctokitResponse | null>; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "3.6.2"; | ||
export declare const VERSION = "3.6.3"; |
{ | ||
"name": "@octokit/oauth-app", | ||
"description": "GitHub OAuth toolset for Node.js", | ||
"version": "3.6.2", | ||
"version": "3.6.3", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -445,3 +445,2 @@ # oauth-app.js | ||
const { token } = await app.createToken({ | ||
state: "state123", | ||
code: "code123", | ||
@@ -448,0 +447,0 @@ }); |
Sorry, the diff of this file is not supported yet
158767
1832
1153