mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 09:40:17 +08:00
17 lines
512 B
JavaScript
17 lines
512 B
JavaScript
import * as OAuthMethods from "@octokit/oauth-methods";
|
|
async function checkTokenWithState(state, options) {
|
|
const result = await OAuthMethods.checkToken({
|
|
// @ts-expect-error not worth the extra code to appease TS
|
|
clientType: state.clientType,
|
|
clientId: state.clientId,
|
|
clientSecret: state.clientSecret,
|
|
request: state.octokit.request,
|
|
...options
|
|
});
|
|
Object.assign(result.authentication, { type: "token", tokenType: "oauth" });
|
|
return result;
|
|
}
|
|
export {
|
|
checkTokenWithState
|
|
};
|