mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-18 06:17:21 +00:00
- ModuleManager: Central tracking for installed marketplace modules - DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module) - BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings - RootShell: Real root command execution utility - TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands - Terminal Pro module: Adds aliases (ll, la, h), command history - ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games - fade_in/fade_out animations for smooth transitions
33 lines
1 KiB
TypeScript
33 lines
1 KiB
TypeScript
import type { VercelRequest, VercelResponse } from "@vercel/node";
|
|
|
|
export const config = {
|
|
runtime: "nodejs",
|
|
};
|
|
|
|
export default async function handler(req: VercelRequest, res: VercelResponse) {
|
|
if (req.method !== "GET") {
|
|
res.setHeader("Allow", "GET");
|
|
return res.status(405).json({ error: "Method not allowed" });
|
|
}
|
|
|
|
const clientId = process.env.GITHUB_OAUTH_CLIENT_ID;
|
|
if (!clientId) {
|
|
console.error("[GitHub OAuth] Missing GITHUB_OAUTH_CLIENT_ID");
|
|
return res.status(500).json({ error: "GitHub OAuth not configured" });
|
|
}
|
|
|
|
const { state } = req.query;
|
|
const apiBase = process.env.VITE_API_BASE || "https://aethex.dev";
|
|
const redirectUri = `${apiBase}/api/github/oauth/callback`;
|
|
|
|
// Build GitHub authorization URL
|
|
const params = new URLSearchParams({
|
|
client_id: clientId,
|
|
redirect_uri: redirectUri,
|
|
scope: "user:email",
|
|
state: state ? decodeURIComponent(state as string) : "",
|
|
});
|
|
|
|
const githubAuthUrl = `https://github.com/login/oauth/authorize?${params.toString()}`;
|
|
return res.redirect(githubAuthUrl);
|
|
}
|