fix(api): 🐛 Fix incorrect providers being returned by oauth providers endpoint

This commit is contained in:
Jesse Wierzbinski 2024-05-06 08:36:00 +00:00
parent 516bfb72e7
commit d5076590c6
No known key found for this signature in database

View file

@ -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,
})),
);
});