mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(api): 🐛 Fix incorrect providers being returned by oauth providers endpoint
This commit is contained in:
parent
516bfb72e7
commit
d5076590c6
|
|
@ -1,6 +1,7 @@
|
||||||
import { applyConfig } from "@api";
|
import { applyConfig } from "@api";
|
||||||
import { jsonResponse } from "@response";
|
import { jsonResponse } from "@response";
|
||||||
import type { Hono } from "hono";
|
import type { Hono } from "hono";
|
||||||
|
import { config } from "~packages/config-manager";
|
||||||
|
|
||||||
export const meta = applyConfig({
|
export const meta = applyConfig({
|
||||||
allowedMethods: ["GET"],
|
allowedMethods: ["GET"],
|
||||||
|
|
@ -16,16 +17,11 @@ export const meta = applyConfig({
|
||||||
|
|
||||||
export default (app: Hono) =>
|
export default (app: Hono) =>
|
||||||
app.on(meta.allowedMethods, meta.route, async () => {
|
app.on(meta.allowedMethods, meta.route, async () => {
|
||||||
return jsonResponse([
|
return jsonResponse(
|
||||||
{
|
config.oidc.providers.map((p) => ({
|
||||||
name: "GitHub",
|
name: p.name,
|
||||||
icon: "github",
|
icon: p.icon,
|
||||||
id: "github",
|
id: p.id,
|
||||||
},
|
})),
|
||||||
{
|
);
|
||||||
name: "Google",
|
|
||||||
icon: "google",
|
|
||||||
id: "google",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue