👔 (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

@ -1,10 +1,11 @@
import { GitHub } from "arctic";
export const githubProvider = () => {
const redirectURI = `${process.env.APP_PROTOCOL}://${process.env.APP_DOMAIN}${process.env.GITHUB_CLIENT_CALLBACK}`;
export const githubProvider = (
callbackURI = `${process.env.APP_PROTOCOL}://${process.env.APP_DOMAIN}${process.env.GITHUB_DEFAULT_CALLBACK}`
) => {
return new GitHub(
process.env.GITHUB_CLIENT_ID!,
process.env.GITHUB_CLIENT_SECRET!,
redirectURI
callbackURI
);
};