🥅 fix: add error handling for GitHub auth request
All checks were successful
Integration Tests / integration-tests (pull_request) Successful in 29s

This commit is contained in:
2026-02-19 16:46:21 +07:00
parent 1b992522de
commit 427825b186

View File

@ -1,12 +1,22 @@
import { Context } from "elysia";
import { returnReadResponse } from "../../../helpers/callback/httpResponse";
import { githubRequestService } from "../services/http/githubRequest.service";
import { mainErrorHandler } from "../../../helpers/error/handler";
export const githubRequestController = async (
ctx: Context & { query: { callback?: string } }
ctx: Context & { query: { callback?: string } },
) => {
try {
const loginUrl = await githubRequestService(ctx.query.callback);
return returnReadResponse(ctx.set, 200, "Login URL generated successfully", {
return returnReadResponse(
ctx.set,
200,
"Login URL generated successfully",
{
endpointUrl: loginUrl,
});
},
);
} catch (error) {
return mainErrorHandler(ctx.set, error);
}
};