From d5076590c67444eade23d6095e126f8cb360f910 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 6 May 2024 08:36:00 +0000 Subject: [PATCH] fix(api): :bug: Fix incorrect providers being returned by oauth providers endpoint --- server/api/oauth/providers/index.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/server/api/oauth/providers/index.ts b/server/api/oauth/providers/index.ts index f1b56398..29d03ca8 100644 --- a/server/api/oauth/providers/index.ts +++ b/server/api/oauth/providers/index.ts @@ -1,6 +1,7 @@ import { applyConfig } from "@api"; import { jsonResponse } from "@response"; import type { Hono } from "hono"; +import { config } from "~packages/config-manager"; export const meta = applyConfig({ allowedMethods: ["GET"], @@ -16,16 +17,11 @@ export const meta = applyConfig({ export default (app: Hono) => app.on(meta.allowedMethods, meta.route, async () => { - return jsonResponse([ - { - name: "GitHub", - icon: "github", - id: "github", - }, - { - name: "Google", - icon: "google", - id: "google", - }, - ]); + return jsonResponse( + config.oidc.providers.map((p) => ({ + name: p.name, + icon: p.icon, + id: p.id, + })), + ); });