- Create src/middlewares/ folder with separate files: - os.ts: base implementer - auth.ts: authentication middleware - login-request.ts: login request middleware - superuser.ts: chains authMiddleware then checks superuser - Update base.ts to re-export from middlewares - Update admin procedures to use merged superuserMiddleware (no longer need to chain authMiddleware.use(superuserMiddleware)) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
11 lines
311 B
TypeScript
11 lines
311 B
TypeScript
/**
|
|
* Base implementer with typed APIContext
|
|
* All procedures and middlewares should derive from this
|
|
*/
|
|
|
|
import type { APIContext } from "../context.js";
|
|
import { implement } from "@orpc/server";
|
|
import { contract } from "@reviq/api-contract";
|
|
|
|
export const os = implement(contract).$context<APIContext>();
|