Skip to content

Commit

Permalink
legger tilbake måling som logger brukerens default språk
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldlin committed Oct 9, 2023
1 parent 8fcad87 commit 6371d20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {NextResponse} from "next/server";
import type {NextRequest} from "next/server";
import {NextResponse} from "next/server";
import {logger} from "@navikt/next-logger";
import {logBrukerDefaultLanguage} from "./utils/amplitude";

const PUBLIC_FILE = /\.(.*)$/;

Expand Down Expand Up @@ -29,6 +30,7 @@ export async function middleware(request: NextRequest) {

// Sett språk basert på decorator-language cookien
const decoratorLocale = request.cookies.get("decorator-language")?.value ?? "nb";
logBrukerDefaultLanguage(decoratorLocale);
if (decoratorLocale !== request.nextUrl.locale) {
if (request.nextUrl.locale !== "nb") {
const next = NextResponse.next();
Expand Down

0 comments on commit 6371d20

Please sign in to comment.