import { OAuth2Client } from "https://deno.land/x/oauth2_client@v1.0.2/mod.ts";
import {
  GITEA_CLIENT_ID,
  GITEA_CLIENT_SECRET,
  GITEA_REDIRECT_URL,
  GITEA_SERVER,
} from "@lib/env.ts";

export const oauth2Client = new OAuth2Client({
  clientId: GITEA_CLIENT_ID,
  clientSecret: GITEA_CLIENT_SECRET,
  authorizationEndpointUri: `${GITEA_SERVER}/login/oauth/authorize`,
  tokenUri: `${GITEA_SERVER}/login/oauth/access_token`,
  redirectUri: GITEA_REDIRECT_URL,
});
