first commit
This commit is contained in:
15
node_modules/@octokit/auth-token/dist-src/auth.js
generated
vendored
Normal file
15
node_modules/@octokit/auth-token/dist-src/auth.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { isJWT } from "./is-jwt.js";
|
||||
async function auth(token) {
|
||||
const isApp = isJWT(token);
|
||||
const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_");
|
||||
const isUserToServer = token.startsWith("ghu_");
|
||||
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
||||
return {
|
||||
type: "token",
|
||||
token,
|
||||
tokenType
|
||||
};
|
||||
}
|
||||
export {
|
||||
auth
|
||||
};
|
||||
Reference in New Issue
Block a user