mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
feat: privacy page with translation
refactor: apply prettier conf to all files feat: terms of use with translation
This commit is contained in:
@@ -29,14 +29,14 @@ export function middleware(req) {
|
||||
!req.nextUrl.pathname.startsWith("/_next")
|
||||
) {
|
||||
return NextResponse.redirect(
|
||||
new URL(`/${lng}${req.nextUrl.pathname}`, req.url)
|
||||
new URL(`/${lng}${req.nextUrl.pathname}`, req.url),
|
||||
);
|
||||
}
|
||||
|
||||
if (req.headers.has("referer")) {
|
||||
const refererUrl = new URL(req.headers.get("referer"));
|
||||
const lngInReferer = i18n.locales.find((l) =>
|
||||
refererUrl.pathname.startsWith(`/${l}`)
|
||||
refererUrl.pathname.startsWith(`/${l}`),
|
||||
);
|
||||
const response = NextResponse.next();
|
||||
if (lngInReferer) response.cookies.set(cookieName, lngInReferer);
|
||||
|
||||
Reference in New Issue
Block a user