mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-23 00:41:13 +00:00
Adds one-click GitHub App setup via the manifest flow, OAuth login via Arctic, and cookie-based sessions so the app shell shows the real authenticated user instead of a hardcoded placeholder. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16 lines
470 B
TypeScript
16 lines
470 B
TypeScript
import { GitHub, generateState } from "arctic";
|
|
|
|
export { generateState };
|
|
|
|
export function getGitHubOAuth() {
|
|
const clientId = process.env.GITHUB_APP_CLIENT_ID;
|
|
const clientSecret = process.env.GITHUB_APP_CLIENT_SECRET;
|
|
if (!clientId || !clientSecret) {
|
|
throw new Error("GitHub App is not configured");
|
|
}
|
|
return new GitHub(clientId, clientSecret, null);
|
|
}
|
|
|
|
export function isGitHubAppConfigured(): boolean {
|
|
return !!process.env.GITHUB_APP_CLIENT_ID;
|
|
}
|