/* =====================================================================
   routes/auth.js — OAuth-Start/Callback für Google + PayPal-Login. 1:1 portiert aus
   functions/api/auth/google/{start,callback}.js + functions/api/auth/paypal/{start,callback}.js
   (beide Anbieter nutzen dieselbe gemeinsame Logik, siehe lib/oauth-handlers.js).
   ===================================================================== */

import { Router } from "express";
import { starteOAuth, verarbeiteOAuthCallback } from "../lib/oauth-handlers.js";

export const authRouter = Router();

authRouter.get("/api/auth/google/start", (req, res) => starteOAuth(req, res, "google"));
authRouter.get("/api/auth/google/callback", (req, res) => verarbeiteOAuthCallback(req, res, "google"));
authRouter.get("/api/auth/paypal/start", (req, res) => starteOAuth(req, res, "paypal"));
authRouter.get("/api/auth/paypal/callback", (req, res) => verarbeiteOAuthCallback(req, res, "paypal"));
