First upload version 0.0.1
This commit is contained in:
29
node_modules/@octokit/oauth-app/dist-src/methods/get-user-octokit.js
generated
vendored
Normal file
29
node_modules/@octokit/oauth-app/dist-src/methods/get-user-octokit.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { createOAuthUserAuth } from "@octokit/auth-oauth-user";
|
||||
import { emitEvent } from "../emit-event.js";
|
||||
async function getUserOctokitWithState(state, options) {
|
||||
return state.octokit.auth({
|
||||
type: "oauth-user",
|
||||
...options,
|
||||
async factory(options2) {
|
||||
const octokit = new state.Octokit({
|
||||
authStrategy: createOAuthUserAuth,
|
||||
auth: options2
|
||||
});
|
||||
const authentication = await octokit.auth({
|
||||
type: "get"
|
||||
});
|
||||
await emitEvent(state, {
|
||||
name: "token",
|
||||
action: "created",
|
||||
token: authentication.token,
|
||||
scopes: authentication.scopes,
|
||||
authentication,
|
||||
octokit
|
||||
});
|
||||
return octokit;
|
||||
}
|
||||
});
|
||||
}
|
||||
export {
|
||||
getUserOctokitWithState
|
||||
};
|
||||
Reference in New Issue
Block a user