v3: added opengraph support to the app, wrote README instructions incl. a Docker image

This commit is contained in:
khannurien
2026-03-26 19:55:48 +00:00
parent 0cb5a798c7
commit ca70bdc14b
26 changed files with 551 additions and 120 deletions

View File

@@ -5,6 +5,7 @@ import {
APIException,
type AuthPayload,
} from "../model/interfaces.ts";
import { getUserById } from "../services/user-service.ts";
export interface AuthContext extends Context {
state: AuthState;
@@ -32,6 +33,12 @@ export async function authMiddleware(ctx: AuthContext, next: Next) {
throw new APIException(APIErrorCode.UNAUTHORIZED, 401, "Invalid token");
}
try {
getUserById(payload.userId);
} catch {
throw new APIException(APIErrorCode.UNAUTHORIZED, 401, "User not found");
}
ctx.state.user = payload;
await next();