Compare commits
2 Commits
1b992522de
...
7e5168f1fc
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e5168f1fc | |||
| 427825b186 |
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user