mirror of
https://github.com/better-auth/better-auth.git
synced 2026-07-30 17:12:35 -05:00
chore: removed unused middleware (#1678)
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
import { type UserWithRole } from "./admin";
|
||||
import { APIError, createAuthMiddleware, getSessionFromCtx } from "../../api";
|
||||
import { type Session } from "../../types";
|
||||
|
||||
export const adminMiddleware = createAuthMiddleware(async (ctx) => {
|
||||
const session = await getSessionFromCtx(ctx);
|
||||
if (!session?.session) {
|
||||
throw new APIError("UNAUTHORIZED");
|
||||
}
|
||||
return {
|
||||
session,
|
||||
} as {
|
||||
session: {
|
||||
user: UserWithRole;
|
||||
session: Session;
|
||||
};
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user