mirror of
https://github.com/versia-pub/server.git
synced 2025-12-07 00:48:18 +01:00
feat(federation): ✨ Add avatar attribute to WebFinger
This commit is contained in:
parent
d892ff68fd
commit
99822a716d
2
index.ts
2
index.ts
|
|
@ -54,7 +54,7 @@ if (isEntry) {
|
||||||
await dualServerLogger.log(
|
await dualServerLogger.log(
|
||||||
LogLevel.CRITICAL,
|
LogLevel.CRITICAL,
|
||||||
"Server",
|
"Server",
|
||||||
"Below is a generated key for you to copy in the config at oidc.jwt_private_key",
|
"Below is a generated key for you to copy in the config at oidc.jwt_key",
|
||||||
);
|
);
|
||||||
// Generate a key for them
|
// Generate a key for them
|
||||||
const keys = await crypto.subtle.generateKey("Ed25519", true, [
|
const keys = await crypto.subtle.generateKey("Ed25519", true, [
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { apiRoute, applyConfig, idValidator } from "@api";
|
import { apiRoute, applyConfig, idValidator } from "@api";
|
||||||
import { errorResponse, jsonResponse } from "@response";
|
import { errorResponse, jsonResponse } from "@response";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { findFirstUser } from "~database/entities/User";
|
import { findFirstUser, getAvatarUrl } from "~database/entities/User";
|
||||||
|
import { lookup } from "mime-types";
|
||||||
|
|
||||||
export const meta = applyConfig({
|
export const meta = applyConfig({
|
||||||
allowedMethods: ["GET"],
|
allowedMethods: ["GET"],
|
||||||
|
|
@ -67,6 +68,11 @@ export default apiRoute<typeof meta, typeof schema>(
|
||||||
config.http.base_url,
|
config.http.base_url,
|
||||||
).toString(),
|
).toString(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
rel: "avatar",
|
||||||
|
type: lookup(getAvatarUrl(user, config)),
|
||||||
|
href: getAvatarUrl(user, config),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue