Merge pull request '🥅 fix: add error handling for GitHub auth request' (#19) from fix-github-auth into main
All checks were successful
Sync to GitHub / sync (push) Successful in 9s

Reviewed-on: #19
This commit is contained in:
2026-02-19 17:21:43 +07:00

View File

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