(req: BunRequest)
| 119 | } |
| 120 | |
| 121 | export 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 | } |
nothing calls this directly
no test coverage detected