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

Function getAuthenticatedUser

api/src/services/auth.ts:121–137  ·  view source on GitHub ↗
(req: BunRequest)

Source from the content-addressed store, hash-verified

119}
120
121export async function getAuthenticatedUser(req: BunRequest) {
122 const session = await getUserSession(req);
123 if (!session)
124 return Response.json(
125 {
126 state: "Failed",
127 message: "No active session found.",
128 },
129 {
130 status: 401,
131 }
132 );
133 const octokit = createOctokitFromSession(session);
134 const user = await octokit.rest.users.getAuthenticated();
135 console.log("Authenticated user:", user.data.login);
136 return Response.json(user.data);
137}

Callers

nothing calls this directly

Calls 2

getUserSessionFunction · 0.85
createOctokitFromSessionFunction · 0.85

Tested by

no test coverage detected