@octokit/auth-token
Version:
GitHub API token authentication for browsers and Node.js
13 lines (12 loc) • 321 B
JavaScript
import { withAuthorizationPrefix } from "./with-authorization-prefix.js";
async function hook(token, request, route, parameters) {
const endpoint = request.endpoint.merge(
route,
parameters
);
endpoint.headers.authorization = withAuthorizationPrefix(token);
return request(endpoint);
}
export {
hook
};