diff --git a/src/middleware.ts b/src/middleware.ts index edcaa57e8..254597777 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -3,7 +3,6 @@ import { initSession } from '@/middlewares/initSession'; import { verifyMiddleware } from '@/middlewares/verifyMiddleware'; import { getIronSession } from 'iron-session/edge'; import { edgeLogger } from '@/logger'; -// eslint-disable-next-line @next/next/no-server-import-in-page import { NextRequest, NextResponse } from 'next/server'; const log = edgeLogger.child({}, { msgPrefix: '[middleware] ' }); diff --git a/src/middlewares/botCheck.ts b/src/middlewares/botCheck.ts index 12088fa38..b3f6a73f3 100644 --- a/src/middlewares/botCheck.ts +++ b/src/middlewares/botCheck.ts @@ -1,7 +1,6 @@ import { sessionConfig } from '@/config'; import { getIronSession } from 'iron-session/edge'; import { edgeLogger } from '@/logger'; -// eslint-disable-next-line @next/next/no-server-import-in-page import { NextRequest, NextResponse, userAgent } from 'next/server'; import { IronSessionData } from 'iron-session'; @@ -43,13 +42,22 @@ const getBotToken = (result: CRAWLER_RESULT): IronSessionData['token'] => { switch (result) { case CRAWLER_RESULT.BOT: log.debug('Bot detected'); - return { access_token: process.env.VERIFIED_BOTS_ACCESS_TOKEN, ...baseToken }; + return { + access_token: process.env.VERIFIED_BOTS_ACCESS_TOKEN, + ...baseToken, + }; case CRAWLER_RESULT.UNVERIFIABLE: log.debug('Unverifiable bot detected'); - return { access_token: process.env.UNVERIFIABLE_BOTS_ACCESS_TOKEN, ...baseToken }; + return { + access_token: process.env.UNVERIFIABLE_BOTS_ACCESS_TOKEN, + ...baseToken, + }; case CRAWLER_RESULT.POTENTIAL_MALICIOUS_BOT: log.debug('Potentially malicious bot detected'); - return { access_token: process.env.MALICIOUS_BOTS_ACCESS_TOKEN, ...baseToken }; + return { + access_token: process.env.MALICIOUS_BOTS_ACCESS_TOKEN, + ...baseToken, + }; case CRAWLER_RESULT.HUMAN: default: log.debug('Human detected'); diff --git a/src/middlewares/decorateHeaders.ts b/src/middlewares/decorateHeaders.ts index 6b763e973..bd6c4b8ee 100644 --- a/src/middlewares/decorateHeaders.ts +++ b/src/middlewares/decorateHeaders.ts @@ -1,5 +1,4 @@ import { edgeLogger } from '@/logger'; -// eslint-disable-next-line @next/next/no-server-import-in-page import { NextRequest } from 'next/server'; const log = edgeLogger.child({}, { msgPrefix: '[decorateHeaders] ' }); diff --git a/src/middlewares/verifyMiddleware.ts b/src/middlewares/verifyMiddleware.ts index 953085a76..cd949b469 100644 --- a/src/middlewares/verifyMiddleware.ts +++ b/src/middlewares/verifyMiddleware.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line @next/next/no-server-import-in-page import { NextRequest, NextResponse } from 'next/server'; import { getIronSession } from 'iron-session/edge'; import { sessionConfig } from '@/config'; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 6accbe33f..58c312b27 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -24,7 +24,7 @@ import '../styles/page-loader.css'; import { logger } from '@/logger'; import { GoogleTagManager, sendGTMEvent } from '@next/third-parties/google'; import Head from 'next/head'; -import { APP_DEFAULTS, BRAND_NAME_FULL } from '@/config'; +import { BRAND_NAME_FULL } from '@/config'; if (process.env.NEXT_PUBLIC_API_MOCKING === 'enabled' && process.env.NODE_ENV !== 'production') { require('../mocks');