mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Proxy all OIDC provider icons
This commit is contained in:
parent
6e7d16864a
commit
e9f504aa0c
|
|
@ -92,7 +92,7 @@ export default (app: Hono) =>
|
||||||
forced: false,
|
forced: false,
|
||||||
providers: config.oidc.providers.map((p) => ({
|
providers: config.oidc.providers.map((p) => ({
|
||||||
name: p.name,
|
name: p.name,
|
||||||
icon: p.icon,
|
icon: proxyUrl(p.icon) || undefined,
|
||||||
id: p.id,
|
id: p.id,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { applyConfig, auth, handleZodError } from "@/api";
|
import { applyConfig, auth, handleZodError } from "@/api";
|
||||||
import { errorResponse, jsonResponse, response } from "@/response";
|
import { errorResponse, jsonResponse, proxyUrl, response } from "@/response";
|
||||||
import { zValidator } from "@hono/zod-validator";
|
import { zValidator } from "@hono/zod-validator";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import type { Hono } from "hono";
|
import type { Hono } from "hono";
|
||||||
|
|
@ -77,7 +77,7 @@ export default (app: Hono) =>
|
||||||
return jsonResponse({
|
return jsonResponse({
|
||||||
id: issuer.id,
|
id: issuer.id,
|
||||||
name: issuer.name,
|
name: issuer.name,
|
||||||
icon: issuer.icon,
|
icon: proxyUrl(issuer.icon) || undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
case "DELETE": {
|
case "DELETE": {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { applyConfig, auth, handleZodError, jsonOrForm } from "@/api";
|
import { applyConfig, auth, handleZodError, jsonOrForm } from "@/api";
|
||||||
import { oauthRedirectUri } from "@/constants";
|
import { oauthRedirectUri } from "@/constants";
|
||||||
import { randomString } from "@/math";
|
import { randomString } from "@/math";
|
||||||
import { errorResponse, jsonResponse } from "@/response";
|
import { errorResponse, jsonResponse, proxyUrl } from "@/response";
|
||||||
import { zValidator } from "@hono/zod-validator";
|
import { zValidator } from "@hono/zod-validator";
|
||||||
import type { Hono } from "hono";
|
import type { Hono } from "hono";
|
||||||
import {
|
import {
|
||||||
|
|
@ -84,7 +84,7 @@ export default (app: Hono) =>
|
||||||
return {
|
return {
|
||||||
id: issuer.id,
|
id: issuer.id,
|
||||||
name: issuer.name,
|
name: issuer.name,
|
||||||
icon: issuer.icon,
|
icon: proxyUrl(issuer.icon) || undefined,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(Boolean) as {
|
.filter(Boolean) as {
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ export default (app: Hono) =>
|
||||||
forced: false,
|
forced: false,
|
||||||
providers: config.oidc.providers.map((p) => ({
|
providers: config.oidc.providers.map((p) => ({
|
||||||
name: p.name,
|
name: p.name,
|
||||||
icon: p.icon,
|
icon: proxyUrl(p.icon) || undefined,
|
||||||
id: p.id,
|
id: p.id,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue