feat(federation): Handle instances not existing

This commit is contained in:
Jesse Wierzbinski 2024-12-02 15:07:05 +01:00
parent deee65ad6d
commit 91da99c934
No known key found for this signature in database
4 changed files with 33 additions and 9 deletions

View file

@ -106,6 +106,13 @@ export default apiRoute((app) =>
// Try to fetch it from database
const instance = await Instance.resolveFromHost(instanceHost);
if (!instance) {
return context.json(
{ error: `Instance ${instanceHost} not found` },
404,
);
}
const account = await User.fromSql(
and(
eq(Users.username, username),