feat: privacy page with translation

refactor: apply prettier conf to all files

feat: terms of use with translation
This commit is contained in:
Sonny
2023-11-19 18:58:49 +01:00
parent 5bdd42afdb
commit 6d5afee4f4
55 changed files with 725 additions and 118 deletions

View File

@@ -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);