OpenAPI Generierung verbessert
This commit is contained in:
@@ -2,6 +2,7 @@ import { decodeToken } from "#lib/auth/token.js";
|
||||
import { hashPassword } from "#lib/password.js";
|
||||
import { prisma } from "@ibcornelsen/database/server";
|
||||
import { APIError, TypesafeAPIContextWithRequest } from "astro-typesafe-api/server";
|
||||
import { z } from "zod";
|
||||
|
||||
export async function authorizationMiddleware(input: any, context: TypesafeAPIContextWithRequest<any>) {
|
||||
const authorization: string | undefined = context.request.headers.get("Authorization");
|
||||
@@ -86,4 +87,8 @@ export async function maybeAuthorizationMiddleware(input: any, ctx: TypesafeAPIC
|
||||
} catch(e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export const authorizationHeaders = {
|
||||
Authorization: z.string()
|
||||
}
|
||||
Reference in New Issue
Block a user