Skip to content

Commit

Permalink
attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sspenst committed Mar 22, 2024
1 parent 99366c1 commit 7e76559
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/withAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function getUserFromToken(

if (!isLocal()) {
newrelic?.addCustomAttribute && newrelic.addCustomAttribute('userId', userId);
newrelic?.addCustomAttribute && newrelic.addCustomAttribute('logBody', JSON.stringify(req?.body));
}

await dbConnect();
Expand Down Expand Up @@ -109,13 +110,6 @@ export default function withAuth(
}

try {
// dynamically import newrelic
const newrelic = process.env.NODE_ENV === 'test' ? undefined : await import('newrelic');

if (!isLocal()) {
newrelic?.addCustomAttribute && newrelic.addCustomAttribute('request.body', req.body);
}

const reqUser = await getUserFromToken(token, req);

if (reqUser === null) {
Expand Down

0 comments on commit 7e76559

Please sign in to comment.