MCPcopy Index your code
hub / github.com/BingyanStudio/github-analyzer / createOctokitFromSession

Function createOctokitFromSession

api/src/services/auth.ts:107–119  ·  view source on GitHub ↗
(session: UserSession)

Source from the content-addressed store, hash-verified

105
106// Helper to create an authenticated Octokit instance from a session
107export function createOctokitFromSession(session: UserSession): Octokit {
108 return new Octokit({
109 authStrategy: createOAuthUserAuth,
110 auth: {
111 clientId: process.env.GITHUB_CLIENT_ID,
112 clientSecret: process.env.GITHUB_CLIENT_SECRET,
113 token: session.accessToken,
114 refreshToken: session.refreshToken,
115 expiresAt: session.expiresAt,
116 tokenType: session.tokenType,
117 },
118 });
119}
120
121export async function getAuthenticatedUser(req: BunRequest) {
122 const session = await getUserSession(req);

Callers 3

fetchUserDataEndpointFunction · 0.90
startFunction · 0.90
getAuthenticatedUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected