-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Open
<
8000
span class="Box-sc-62in7e-0 CopyToClipboardButton-module__tooltip--HDUYz prc-TooltipV2-Tooltip-cYMVY" data-direction="s" aria-label="Copy link" aria-hidden="true" id=":Ru96b:">Copy link
Labels
Description
Hi, I tried the Next.js App Router example. (#122)
I modified the middleware to log error.
Before
rollbar-react/examples/nextjs-approuter/src/app/middleware.ts
Lines 4 to 8 in 418412d
export function middleware(request: NextRequest) { | |
rollbar.configure({ payload: { context: request.nextUrl.pathname } }); | |
return NextResponse.next(); | |
} |
After
export function middleware(request: NextRequest) {
rollbar.configure({ payload: { context: request.nextUrl.pathname } });
rollbar.error('error!', (err, response) => {
// insufficient privileges: post_client_item scope is required but the access token only has post_server_item.
console.log('error', err, response);
});
return NextResponse.next();
}
But as commented above, this causes insufficient privileges
error.
If I change the server token to a client post token here:
accessToken: process.env.POST_SERVER_ITEM_TOKEN, |
The middleware can log the error.
But should I use the client post token in the middleware?
Is there a way to recommend?
tnyo43, alexookah and tasandberg