👔 (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,9 +2,9 @@ import * as arctic from "arctic";
import { githubProvider } from "../../providers/github.provider";
import { AppError } from "../../../../helpers/error/instances/app";
export const githubRequestService = async () => {
export const githubRequestService = async (callbackURI?: string) => {
try {
const github = githubProvider();
const github = githubProvider(callbackURI);
const state = arctic.generateState();
const scopes = ["user:email"];
const url = github.createAuthorizationURL(state, scopes);