mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
15 lines
511 B
TypeScript
15 lines
511 B
TypeScript
import type { NextRequest, NextResponse } from 'next/server';
|
|
|
|
import config from 'configs/app';
|
|
import * as cookiesLib from 'lib/cookies';
|
|
|
|
export default function scamTokensMiddleware(req: NextRequest, res: NextResponse) {
|
|
if (config.UI.views.token.hideScamTokensEnabled) {
|
|
const showScamTokensCookie = req.cookies.get(cookiesLib.NAMES.SHOW_SCAM_TOKENS);
|
|
|
|
if (!showScamTokensCookie) {
|
|
res.cookies.set(cookiesLib.NAMES.SHOW_SCAM_TOKENS, 'false', cookiesLib.getDefaultAttributes());
|
|
}
|
|
}
|
|
}
|