feat: add sentry report wrapper to every api route in appDir (#19966)
* update oauth tests * fix parseRequestData * add logging * add fallback * use ?? * updates * use parseUrlFormData in saml/callback * update tests * fix * remove log * update * any -> unknown * use HttpErrors * addressed * unknown -> any * feat: Add entry report wrapper to every api route in appDir * fix * fix unit test * fix
This commit is contained in:
1 parent
1e9f3a8060
commit
87bc8d649a
49 files changed
+180
-76
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { defaultResponderForAppDir } from "app/api/defaultResponderForAppDir";
|
||||
import type { NextRequest } from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import z from "zod";
|
||||
@@ -16,7 +17,7 @@ const appCredentialWebhookRequestBodySchema = z.object({
|
||||
keys: z.string(),
|
||||
});
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
async function postHandler(request: NextRequest) {
|
||||
if (!APP_CREDENTIAL_SHARING_ENABLED) {
|
||||
return NextResponse.json({ message: "Credential sharing is not enabled" }, { status: 403 });
|
||||
}
|
||||
@@ -101,3 +102,5 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json({ message: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = defaultResponderForAppDir(postHandler);
|
||||
Reference in new issue
Block a user