Added impersonation for admins
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import { db } from "@/lib/db"
|
||||
import fetchUserUsingAPI from "@/lib/validate-api";
|
||||
import fetchUserWithImpersonation from "@/lib/fetch-user-impersonation";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
try {
|
||||
const user = await fetchUserUsingAPI(req)
|
||||
const user = await fetchUserWithImpersonation(req)
|
||||
if (!user) {
|
||||
return new NextResponse("Unauthorized", { status: 401 });
|
||||
}
|
||||
|
Reference in New Issue
Block a user