feat: add Google/GitHub social login for Demo environment (GRO-531)
- auth.ts: add google/github social providers from better-auth/social-providers - auth.ts: add getActiveProviders() to enumerate configured OAuth/social providers - index.ts: add /api/auth/providers public endpoint for frontend - App.tsx: update LoginPage to show Google/GitHub buttons based on /api/auth/providers response Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -2,7 +2,7 @@ import { serve } from "@hono/node-server";
|
||||
import { Hono } from "hono";
|
||||
import { logger } from "hono/logger";
|
||||
import { cors } from "hono/cors";
|
||||
import { getAuth, initAuth } from "./lib/auth.js";
|
||||
import { getAuth, initAuth, getActiveProviders } from "./lib/auth.js";
|
||||
import { clientsRouter } from "./routes/clients.js";
|
||||
import { petsRouter } from "./routes/pets.js";
|
||||
import { servicesRouter } from "./routes/services.js";
|
||||
@@ -92,6 +92,11 @@ app.get("/api/setup/status", async (c) => {
|
||||
return c.json({ needsSetup: !superUser });
|
||||
});
|
||||
|
||||
// Public auth providers endpoint — no auth required, tells frontend which login options are available
|
||||
app.get("/api/auth/providers", async (c) => {
|
||||
return c.json({ providers: getActiveProviders() });
|
||||
});
|
||||
|
||||
// Protected API routes
|
||||
const api = app.basePath("/api");
|
||||
api.use("*", authMiddleware);
|
||||
|
||||
Reference in New Issue
Block a user