👔 (oauth) add callback URI options

provides the option to define a callback URI following a request from the frontend; if not defined, it will
automatically use the backend's default URI.
This commit is contained in:
2025-08-13 18:51:10 +07:00
parent 89ebfb8aa4
commit 3df1f342fc
4 changed files with 12 additions and 9 deletions

View File

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