-
-
- ,
- }),
- }}
- />
-
- >
- );
-}
diff --git a/src/app/deprecated/(authenticated)/user/dashboard/page.tsx b/src/app/deprecated/(authenticated)/user/dashboard/page.tsx
deleted file mode 100644
index 4f3d3271b..000000000
--- a/src/app/deprecated/(authenticated)/user/dashboard/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import { redirect } from "next/navigation";
-
-export default function UserDashboard() {
- redirect("/user/breaches");
-}
diff --git a/src/app/deprecated/(authenticated)/user/layout.tsx b/src/app/deprecated/(authenticated)/user/layout.tsx
deleted file mode 100644
index 66dd56a1f..000000000
--- a/src/app/deprecated/(authenticated)/user/layout.tsx
+++ /dev/null
@@ -1,152 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import { ReactNode } from "react";
-import Image from "next/image";
-import Script from "next/script";
-
-import { logger } from "../../../functions/server/logging";
-import "../../../../client/css/index.css";
-import { UserMenu } from "../../components/client/UserMenu";
-import { SignInButton } from "../../components/client/SignInButton";
-import { SiteNavigation } from "../../components/client/SiteNavigation";
-import AppConstants from "../../../../appConstants.js";
-import MonitorLogo from "../../../../client/images/monitor-logo-transparent@2x.webp";
-import MozillaLogo from "../../../../client/images/moz-logo-1color-white-rgb-01.svg";
-import { getL10n } from "../../../functions/server/l10n";
-import { getNonce } from "../../functions/server/getNonce";
-import { PageLoadEvent } from "../../../components/client/PageLoadEvent";
-import { getExperiments } from "../../../functions/server/getExperiments";
-import { getEnabledFeatureFlags } from "../../../../db/tables/featureFlags";
-import { getServerSession } from "../../../functions/server/getServerSession";
-
-export type Props = {
- children: ReactNode;
-};
-
-const MainLayout = async (props: Props) => {
- const session = await getServerSession();
- if (!session?.user?.subscriber) {
- return ;
- }
-
- const userId = session.user.subscriber.fxa_uid ?? "";
-
- if (!userId) {
- logger.error("No user ID for telemetry");
- }
-
- try {
- // TODO For initial A/A testing `features` is unused. https://mozilla-hub.atlassian.net/browse/MNTOR-2182
- const features = await getExperiments(userId);
- // TODO remove debug for A/A testing https://mozilla-hub.atlassian.net/browse/MNTOR-2182
- logger.debug("Nimbus features in authenticated session:", features);
- } catch (ex) {
- logger.error("Could not fetch Nimbus features:", ex);
- }
-
- const l10n = getL10n();
- const enabledFeatureFlags = await getEnabledFeatureFlags({
- email: session.user.email,
- });
-
- return (
- <>
-
-
-
-
- );
-};
-
-export default async function Settings() {
- const l10n = getL10n();
- const session = await getServerSession();
- if (!session || !session.user?.subscriber) {
- return redirect("/");
- }
-
- // Re-fetch the subscriber every time, rather than reading it from `session`
- // - if the user changes their preferences on this page, the JSON web token
- // containing the subscriber data won't be updated until the next sign-in.
- // (Possibly we shouldn't store subscriber data in that token in the first
- // place, other than their ID?)
- const subscriber = await getSubscriberById(session.user.subscriber.id);
- const emails = await getUserEmails(session.user.subscriber.id);
- // Add primary subscriber email to the list
- emails.push({
- email: session.user.subscriber.primary_email,
- sha1: session.user.subscriber.primary_sha1,
- primary: true,
- verified: true,
- // This is old code that mixed objects with different structure in the same
- // array, hence the need to assert `any`:
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- } as any);
-
- const breachCounts = new Map();
- const allBreaches = await getBreaches();
- for (const email of emails) {
- const breaches = await getBreachesForEmail(
- getSha1(email.email),
- allBreaches,
- true,
- );
- breachCounts.set(email.email, breaches?.length || 0);
- }
-
- return (
- <>
-
-
-
-
-
- >
- );
-}
diff --git a/src/app/deprecated/(dialogs)/user/dialog/addEmail/route.ts b/src/app/deprecated/(dialogs)/user/dialog/addEmail/route.ts
deleted file mode 100644
index 8acc45f72..000000000
--- a/src/app/deprecated/(dialogs)/user/dialog/addEmail/route.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import { NextResponse } from "next/server";
-
-import { getComponentAsString } from "../../../../functions/server/getComponentAsString";
-import AddEmailDialog from "../../../../components/server/AddEmailDialog";
-
-export async function GET() {
- try {
- const dialogContentString = await getComponentAsString({
- component: AddEmailDialog(),
- });
-
- return new NextResponse(dialogContentString, { status: 200 });
- } catch (e) {
- return NextResponse.json({ success: false }, { status: 500 });
- }
-}
diff --git a/src/app/deprecated/(guest)/layout.tsx b/src/app/deprecated/(guest)/layout.tsx
deleted file mode 100644
index 80d51e170..000000000
--- a/src/app/deprecated/(guest)/layout.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import { v5 as uuidv5 } from "uuid";
-import { ReactNode } from "react";
-
-import { logger } from "../../functions/server/logging";
-import "../../../client/css/index.css";
-import Image from "next/image";
-import MonitorLogo from "../../../client/images/monitor-logo-transparent@2x.webp";
-import MozillaLogo from "../../../client/images/moz-logo-1color-white-rgb-01.svg";
-import { SignInButton } from "../components/client/SignInButton";
-import { getL10n } from "../../functions/server/l10n";
-import { getServerSession } from "../../functions/server/getServerSession";
-import { PageLoadEvent } from "../../components/client/PageLoadEvent";
-import { getExperiments } from "../../functions/server/getExperiments";
-import { getEnabledFeatureFlags } from "../../../db/tables/featureFlags";
-import { getUserId } from "../../functions/server/getUserId";
-
-export type Props = {
- children: ReactNode;
-};
-
-const GuestLayout = async (props: Props) => {
- const l10n = getL10n();
-
- // If the user is logged in, use UUID derived from FxA UID as Nimbus user ID.
- const session = await getServerSession();
- const userId = getUserId(session);
-
- if (!userId) {
- logger.error("No user ID for Nimbus telemetry");
- }
-
- try {
- // TODO For initial A/A testing `features` is unused. https://mozilla-hub.atlassian.net/browse/MNTOR-2182
- const features = await getExperiments(userId);
- // TODO remove debug for A/A testing https://mozilla-hub.atlassian.net/browse/MNTOR-2182
- logger.debug("Nimbus features in guest session:", features);
- } catch (ex) {
- logger.error("Could not fetch Nimbus features:", ex);
- }
-
- const enabledFlags = await getEnabledFeatureFlags({
- email: session?.user.email ?? "",
- });
-
- return (
- <>
-
-
-
-
- {props.children}
-
- >
- );
-};
-
-export default GuestLayout;
diff --git a/src/app/deprecated/(guest)/page.tsx b/src/app/deprecated/(guest)/page.tsx
deleted file mode 100644
index 6d6ca0e6a..000000000
--- a/src/app/deprecated/(guest)/page.tsx
+++ /dev/null
@@ -1,168 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import Image from "next/image";
-import Script from "next/script";
-import "../../../client/css/partials/landing.css";
-import { getL10n } from "../../functions/server/l10n";
-
-import HeroImage from "../../../client/images/landing-hero@2x.webp";
-import LaptopImage from "../../../client/images/landing-laptop@2x.webp";
-import LockImage from "../../../client/images/landing-lock@2x.webp";
-import MailImage from "../../../client/images/landing-mail@2x.webp";
-import NaturePhoneImage from "../../../client/images/landing-nature-phone@2x.webp";
-import { getNonce } from "../functions/server/getNonce";
-
-export default function Home() {
- const l10n = getL10n();
-
- return (
-
- {/* These scripts predate the use of React and thus shouldn’t wait for
- hydration to adjust the layout. */}
- {/* eslint-disable @next/next/no-sync-scripts */}
-
-
-
-
- );
-}
diff --git a/src/app/deprecated/(guest)/scan/page.tsx b/src/app/deprecated/(guest)/scan/page.tsx
deleted file mode 100644
index 2d85fc017..000000000
--- a/src/app/deprecated/(guest)/scan/page.tsx
+++ /dev/null
@@ -1,214 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import Script from "next/script";
-import "../../../../client/css/partials/exposureScan.css";
-import Image from "next/image";
-import HeroImage from "../../../../client/images/exposure-scan-hero.svg";
-import NoBreachesImage from "../../../../client/images/breaches-none.svg";
-import { getL10n } from "../../../functions/server/l10n";
-import { getNonce } from "../../functions/server/getNonce";
-
-export function generateMetadata() {
- const l10n = getL10n();
- return {
- title: l10n.getString("breach-scan-meta-title"),
- };
-}
-
-export default function PublicScan() {
- const l10n = getL10n();
-
- return (
-
- );
-};
diff --git a/src/app/deprecated/components/client/SignInButton.tsx b/src/app/deprecated/components/client/SignInButton.tsx
deleted file mode 100644
index 9162580d3..000000000
--- a/src/app/deprecated/components/client/SignInButton.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use client";
-
-import { signIn } from "next-auth/react";
-import { usePathname } from "next/navigation";
-import { useL10n } from "../../../hooks/l10n";
-import { useEffect } from "react";
-
-export type Props = {
- autoSignIn?: boolean;
-};
-
-function initSignIn(callbackUrl: string) {
- void signIn("fxa", { callbackUrl });
-}
-
-export const SignInButton = ({ autoSignIn }: Props) => {
- const l10n = useL10n();
- const pathname = usePathname();
- const callbackUrl = pathname === "/" ? "/user/breaches" : pathname;
-
- useEffect(() => {
- if (autoSignIn) {
- initSignIn(callbackUrl);
- }
- }, [autoSignIn, callbackUrl]);
-
- if (autoSignIn) {
- return null;
- }
-
- return (
-
- );
-};
diff --git a/src/app/deprecated/components/client/SiteNavigation.tsx b/src/app/deprecated/components/client/SiteNavigation.tsx
deleted file mode 100644
index 60b3d8750..000000000
--- a/src/app/deprecated/components/client/SiteNavigation.tsx
+++ /dev/null
@@ -1,110 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use client";
-
-import Image from "next/image";
-import { usePathname } from "next/navigation";
-import { useL10n } from "../../../hooks/l10n";
-
-import RelayLogo from "../../../../client/images/logo-relay.svg";
-import VPNLogo from "../../../../client/images/logo-vpn.svg";
-
-export const SiteNavigation = () => {
- const l10n = useL10n();
- const pathname = usePathname();
-
- const isBreachesPage = pathname === "/user/breaches";
- const isSettingsPage = pathname === "/user/settings";
-
- return (
-
- );
-};
diff --git a/src/app/deprecated/components/client/UserMenu.tsx b/src/app/deprecated/components/client/UserMenu.tsx
deleted file mode 100644
index 237380965..000000000
--- a/src/app/deprecated/components/client/UserMenu.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use client";
-
-import { Session } from "next-auth";
-import Image from "next/image";
-import { signOut } from "next-auth/react";
-import Script from "next/script";
-
-import { useL10n } from "../../../hooks/l10n";
-import OpenInIcon from "../../../../client/images/icon-open-in.svg";
-import SettingsIcon from "../../../../client/images/icon-settings.svg";
-import HelpIcon from "../../../../client/images/icon-help.svg";
-import SignOutIcon from "../../../../client/images/icon-signout.svg";
-import { FeatureFlagName } from "../../../../db/tables/featureFlags";
-
-export type Props = {
- session: Session;
- fxaSettingsUrl: string;
- nonce: string | undefined;
- enabledFeatureFlags: FeatureFlagName[];
-};
-
-export const UserMenu = ({
- session,
- fxaSettingsUrl,
- nonce,
- enabledFeatureFlags,
-}: Props) => {
- const l10n = useL10n();
- if (!session) {
- return null;
- }
-
- return (
-
-
-
-
-
- );
-};
diff --git a/src/app/deprecated/components/client/assets/shield-icon.svg b/src/app/deprecated/components/client/assets/shield-icon.svg
deleted file mode 100644
index 0b67bd26a..000000000
--- a/src/app/deprecated/components/client/assets/shield-icon.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/src/app/deprecated/components/client/assets/shield-outline-icon.svg b/src/app/deprecated/components/client/assets/shield-outline-icon.svg
deleted file mode 100644
index dddeedff9..000000000
--- a/src/app/deprecated/components/client/assets/shield-outline-icon.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/src/app/deprecated/components/server/AddEmailDialog.tsx b/src/app/deprecated/components/server/AddEmailDialog.tsx
deleted file mode 100644
index 837d7678c..000000000
--- a/src/app/deprecated/components/server/AddEmailDialog.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import React from "react";
-import cloudImage from "../../../../client/images/dialog-email-clouds.svg";
-import AppConstants from "../../../../appConstants";
-import { getL10n } from "../../../functions/server/l10n";
-import { CONST_MAX_NUM_ADDRESSES } from "../../../../constants";
-
-export default function AddEmailDialog() {
- const l10n = getL10n();
- const emailLimit = CONST_MAX_NUM_ADDRESSES;
-
- return (
- <>
- {/* Styles need to be included manually when fetching the component via API */}
- {/* eslint-disable-next-line @next/next/no-css-tags */}
-
-
-
- {/* We can’t use next/image when we fetch the component via API */}
- {/* eslint-disable-next-line @next/next/no-img-element */}
-
-
{l10n.getString("add-email-add-another-heading")}
-
-
-
- ${l10n
- .getString("add-email-verify-the-link", {
- email: '',
- "settings-href": 'href="/user/settings"',
- })
- // The following are special characters inserted by Fluent,
- // which break the link when inserted into the tag.
- // (For future strings, we can just `getElement` to properly insert
- // tags into localised strings.)
- .replaceAll("", "")
- .replaceAll("", "")}
-
- `,
- }}
- />
- >
- );
-}
diff --git a/src/app/deprecated/components/server/BreachesTable.tsx b/src/app/deprecated/components/server/BreachesTable.tsx
deleted file mode 100644
index bf9843548..000000000
--- a/src/app/deprecated/components/server/BreachesTable.tsx
+++ /dev/null
@@ -1,228 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import type { UserBreaches } from "../../../functions/server/getUserBreaches";
-import { getL10n } from "../../../functions/server/l10n";
-import { BreachLogo } from "../../../components/server/BreachLogo";
-import { getLocale } from "../../../../utils/fluent.js";
-
-import ImageBreachesNone from "../../../../client/images/breaches-none.svg";
-import ImageBreachesAllResolved from "../../../../client/images/breaches-all-resolved.svg";
-import { HibpLikeDbBreach } from "../../../../utils/hibp";
-import { Breach } from "../../(authenticated)/user/breaches/breaches";
-
-function createResolveSteps(breach: any) {
- const checkedArr = breach.ResolutionsChecked || [];
- const resolveStepsHTML = Object.entries(breach.breachChecklist).map(
- ([key, value]: [string, any]) => `
-
-
-
-
- );
- });
- });
-
- return breachRowsHTML;
- }
-
- return (
- <>
-
- {/* The DOM for this element is modified by regular JavaScript files
- that predate our migration to Next.js. We don’t use any React-specific
- features here, so hydration errors should not be a problem. */}
-
-
- {l10n.getString("column-company")}
- {l10n.getString("column-breached-data")}
- {/* The active/resolved badge does not have a column header, but by
- including an empty , we can re-use the `nth-child`-based
- selectors for the content columns. */}
-
- {l10n.getString("column-detected")}
-
-